| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- // w32def.h :
- //
- #if !defined(AGD_W32DEF_H__F554E2DF_9B41_4A77_A414_F4A4FE09F0D4__INCLUDED_)
- #define AGD_W32DEF_H__F554E2DF_9B41_4A77_A414_F4A4FE09F0D4__INCLUDED_
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
- /////////////////////////////////////////////////////////////////////////////
- // w32def.h - Declarations:
- #define PATH_MAX _MAX_PATH
- #define LOCK_SH 1 /* Shared lock. */
- #define LOCK_EX 2 /* Exclusive lock. */
- #define LOCK_UN 8 /* Unlock. */
- #define IPC_CREAT 01000 /* Create key if key does not exist. */
- #define IPC_EXCL 02000 /* Fail if key exists. */
- #define IPC_NOWAIT 04000 /* Return error on wait. */
- #define IPC_RMID 0 /* Remove identifier. */
- #define IPC_SET 1 /* Set `ipc_perm' options. */
- #define IPC_STAT 2 /* Get `ipc_perm' options. */
- #define IPC_INFO 3
- #define SEM_STAT 18
- #define SEM_INFO 19
- #define SEM_UNDO 0x1000
- #define SHM_RDONLY 010000 /* read-only access */
- #define SHM_RND 020000 /* round attach address to SHMLBA boundary */
- #define SHM_REMAP 040000 /* take-over region on attach */
- #define SHM_EXEC 0100000 /* execution access */
- #define SHM_LOCK 11
- #define SHM_UNLOCK 12
- #define SHM_STAT 13
- #define SHM_INFO 14
- #define GETPID 11 /* get sempid */
- #define GETVAL 12 /* get semval */
- #define GETALL 13 /* get all semval's */
- #define GETNCNT 14 /* get semncnt */
- #define GETZCNT 15 /* get semzcnt */
- #define SETVAL 16 /* set semval */
- #define SETALL 17 /* set all semval's */
- typedef int key_t;
- typedef int uid_t;
- typedef int gid_t;
- typedef unsigned long shmatt_t;
- typedef unsigned short pid_t;
- struct timespec
- {
- time_t tv_sec; /* Seconds */
- long tv_nsec; /* Nanoseconds [0 .. 999999999] */
- };
- int flock(int fd, int operation);
- key_t ftok (const char *__pathname, int __proj_id);
- struct ipc_perm
- {
- key_t __key; /* Key. */
- uid_t uid; /* Owner's user ID. */
- gid_t gid; /* Owner's group ID. */
- uid_t cuid; /* Creator's user ID. */
- gid_t cgid; /* Creator's group ID. */
- unsigned short int mode; /* Read/write permission. */
- unsigned short int __pad1;
- unsigned short int __seq; /* Sequence number. */
- unsigned short int __pad2;
- unsigned long int __unused1;
- unsigned long int __unused2;
- };
- struct seminfo
- {
- int semmap;
- int semmni;
- int semmns;
- int semmnu;
- int semmsl;
- int semopm;
- int semume;
- int semusz;
- int semvmx;
- int semaem;
- };
- struct sembuf
- {
- unsigned short int sem_num; /* semaphore number */
- short int sem_op; /* semaphore operation */
- short int sem_flg; /* operation flag */
- };
-
- struct semid_ds
- {
- struct ipc_perm sem_perm; /* operation permission struct */
- time_t sem_otime; /* last semop() time */
- unsigned long int __unused1;
- time_t sem_ctime; /* last time changed by semctl() */
- unsigned long int __unused2;
- unsigned long int sem_nsems; /* number of semaphores in set */
- unsigned long int __unused3;
- unsigned long int __unused4;
- };
-
- int semctl (int __semid, int __semnum, int __cmd, ...);
- int semget (key_t __key, int __nsems, int __semflg);
- int semop (int __semid, struct sembuf *__sops, size_t __nsops);
- int semtimedop(int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout);
- struct shmid_ds
- {
- struct ipc_perm shm_perm; /* operation perms */
- size_t shm_segsz; /* size of segment (bytes) */
- time_t shm_atime; /* last attach time */
- time_t shm_dtime; /* last detach time */
- time_t shm_ctime; /* last change time */
- pid_t shm_cpid; /* pid of creator */
- pid_t shm_lpid; /* pid of last operator */
- shmatt_t shm_nattch; /* no. of current attaches */
- /* the following are private */
- unsigned short shm_npages; /* size of segment (pages) */
- unsigned long *shm_pages; /* array of ptrs to frames -> SHMMAX */
- struct vm_area_struct *attaches; /* descriptors for attaches */
- };
- struct shminfo
- {
- unsigned long shmmax; /* Maximum segment size */
- unsigned long shmmin; /* Minimum segment size; always 1 */
- unsigned long shmmni; /* Maximum number of segments */
- unsigned long shmseg; /* Maximum number of segments that a process can attach; unused within kernel */
- unsigned long shmall; /* Maximum number of pages of shared memory, system-wide */
- };
- struct shm_info
- {
- int used_ids; /* # of currently existing segments */
- unsigned long shm_tot; /* Total number of shared memory pages */
- unsigned long shm_rss; /* # of resident shared memory pages */
- unsigned long shm_swp; /* # of swapped shared memory pages */
- unsigned long swap_attempts; /* Unused since Linux 2.4 */
- unsigned long swap_successes; /* Unused since Linux 2.4 */
- };
- int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf);
- int shmget (key_t __key, size_t __size, int __shmflg);
- void *shmat (int __shmid, const void *__shmaddr, int __shmflg);
- int shmdt (const void *__shmaddr);
- /////////////////////////////////////////////////////////////////////////////
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #endif // !defined(AGD_W32DEF_H__F554E2DF_9B41_4A77_A414_F4A4FE09F0D4__INCLUDED_)
|