IPC server: NetBSD sync, general improvements

- switch to the NetBSD identifier system; it is not only better, but
  also required for porting NetBSD ipcs(1) and ipcrm(1); however, it
  requires that slots not be moved, and that results in some changes;
- synchronize some other things with NetBSD: where keys are kept, as
  well as various non-permission mode flags;
- fix semctl(2) vararg retrieval and message field type;
- use SUSPEND instead of weird reply exceptions in the call table;
- fix several memory leaks and at least one missing permission check;
- improve the atomicity of semop(2) by a small amount, even though
  its atomicity is still broken at a fundamental level;
- use the new cheaper way to retrieve the current time;
- resolve all level-5 LLVM warnings.

Change-Id: I0c47aacde478b23bb77d628384aeab855a22fdbf
This commit is contained in:
David van Moolenbroek
2015-11-24 23:01:22 +00:00
committed by Lionel Sambuc
parent 58c1923c9f
commit 4d272e5a97
10 changed files with 353 additions and 285 deletions

View File

@@ -187,11 +187,13 @@ struct sem_sysctl_info {
/* actual size of an undo structure */
#define SEMUSZ (sizeof(struct sem_undo)+sizeof(struct sem_undo_entry)*SEMUME)
#ifndef __minix
/*
* Structures allocated in machdep.c
*/
extern struct seminfo seminfo;
extern struct semid_ds *sema; /* semaphore id pool */
#endif /* !__minix */
/*
* Parameters to the semconfig system call

View File

@@ -215,12 +215,12 @@ struct shm_info
unsigned long int swap_successes;
};
#define SHMMNI 4096
#define SHMMNI 1024
#define SHMSEG 32 /* max shared segs per process */
/* shm_mode upper byte flags */
#define SHM_DEST 01000 /* segment will be destroyed on last detach */
#define SHM_LOCKED 02000 /* segment will not be swapped */
/* Public shm_perm.mode flags, synchronized with NetBSD kernel values above */
#define SHM_DEST 0x0400 /* destroy on last detach (SHMSEG_REMOVED) */
#define SHM_LOCKED 0x4000 /* pages will not be swapped (SHMSEG_WIRED) */
#endif /* defined(__minix) */