-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[BUG] kernel/msgqueue.h -- Not Bug. #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not a bug. int main(void)
{
msgqueue_t *mq = msgqueue_create(10, -sizeof (void *));
char str[sizeof (void *) + 6];
char *p = str + sizeof (void *);
strcpy(p, "hello");
msgqueue_put(p, mq);
p = msgqueue_get(mq);
printf("%s\n", p);
return 0;
} |
请问下我改成这样为什么输出为空了: |
Linkoff的位置,需要用户预留一个指针大小的空间。内部要拉链的。 |
好的,谢谢 |
➜ workflow gcc example.c msgqueue.c;./a.out [1] 64749 segmentation fault ./a.out
The text was updated successfully, but these errors were encountered: