English 中文(简体)
me(Smcpy)是否恢复运作?
原标题:Is the memcpy() function reentrant?

I call some C++ functions inside a signal handler and my program is terminated by segmentation fault. When I check with gdb, memcpy() function is where i get SIGSEGV. I would like to know if memcpy() is a reentrant function or not?

问题回答

除了最牢固的平台外,它完全是被动的。 你提到了SIGSEGV,因此我假定它不是其中之一。 在本案中,它最有可能是肉类:它造成了电线人的过失。 如果你要求复印坏点(或坏)的话,那就错了。 你可以轻松地这样做:

memcpy(NULL, NULL, 123456789);

这造成SIGSEGV,它给你带来巨大损失。 当然,这并非是错的——它只是做你告诉它的话。 你的信号手却说话有些奇怪。 打电话者所在地的背书(用 g或你拥有的任何工具)应显示你所说的话。 否则,就只字不提一下你回去的争论。

我看不出为什么不能退步。 我不敢肯定,但我想到的是,在你使用的图书馆基础上,它有很多东西。

Unless memcpy is BADLY carried out, it is reentrant. 它只能与你给它的东西——指点和长度价值——合作。 所有参数均按价值计算,一旦职能启动,无论信号和(或)其他线索如何,这些数值都不会改变。

我认为,问题是,你正在把无效(或删除)点子作为特制功能参数,请仔细检查你的代码。

在这方面。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签