shmctl(2)/shmget(2)/shmat(2) all document
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
as a requirement for calling these functions.
On Sat, Sep 20, 2014 at 01:24:02PM +0300, Matti Karnaattu wrote:
> Hello,
>
> I managed to get build error which was caused a missing include.
>
> test:
> ===================================================================
> #include <sys/shm.h>
>
> int
> main(void)
> {
> return 0;
> }
> ===================================================================
>
> And here is diff that fixes the bug:
>
> Index: ipc.h
> ===================================================================
> RCS file: /OpenBSD/src/sys/sys/ipc.h,v
> retrieving revision 1.12
> diff -u -p -u -p -r1.12 ipc.h
> --- ipc.h 10 Jul 2014 14:16:49 -0000 1.12
> +++ ipc.h 20 Sep 2014 10:05:01 -0000
> @@ -48,6 +48,8 @@
> #ifndef _SYS_IPC_H_
> #define _SYS_IPC_H_
> +#include <sys/types.h>
> +
> struct ipc_perm {
> uid_t cuid; /* creator user id */
> gid_t cgid; /* creator group id */