SysV IPC headers
[reactos.git] / posix / include / sys / shm.h
1 /* $Id: shm.h,v 1.3 2002/05/17 01:37:15 hyperion Exp $
2 */
3 /*
4 * sys/shm.h
5 *
6 * shared memory facility. Conforming to the Single UNIX(r) Specification
7 * Version 2, System Interface & Headers Issue 5
8 *
9 * This file is part of the ReactOS Operating System.
10 *
11 * Contributors:
12 * Created by KJK::Hyperion <noog@libero.it>
13 *
14 * THIS SOFTWARE IS NOT COPYRIGHTED
15 *
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
18 *
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 */
25 #ifndef __SYS_SHM_H_INCLUDED__
26 #define __SYS_SHM_H_INCLUDED__
27
28 /* INCLUDES */
29
30 /* OBJECTS */
31
32 /* TYPES */
33 typedef unsigned short shmatt_t;
34
35 struct shmid_ds
36 {
37 struct ipc_perm shm_perm; /* operation permission structure */
38 size_t shm_segsz; /* size of segment in bytes */
39 pid_t shm_lpid; /* process ID of last shared memory operation */
40 pid_t shm_cpid; /* process ID of creator */
41 shmatt_t shm_nattch; /* number of current attaches */
42 time_t shm_atime; /* time of last shmat() */
43 time_t shm_dtime; /* time of last shmdt() */
44 time_t shm_ctime; /* time of last change by shmctl() */
45 };
46
47 /* CONSTANTS */
48 #define SHM_RDONLY (0x00000200) /* Attach read-only (else read-write). */
49 #define SHM_RND (0x00000400) /* Round attach address to SHMLBA. */
50
51 #define SHMLBA (4096) /* Segment low boundary address multiple. */
52
53 /* PROTOTYPES */
54 void *shmat(int, const void *, int);
55 int shmctl(int, int, struct shmid_ds *);
56 int shmdt(const void *);
57 int shmget(key_t, size_t, int);
58
59 /* MACROS */
60
61 #endif /* __SYS_SHM_H_INCLUDED__ */
62
63 /* EOF */
64