mirror of
https://github.com/openbsd/src.git
synced 2026-04-22 21:24:34 +00:00
shm_open(3): align the type of the mode_t parameter with POSIX
POSIX says that sys/mman.h should also define mode_t which is currently missing. With mode_t defined there, the type of the last parameter of the shm_open function can be changed from __mode_t to mode_t, matching the standard. Both issues flagged by Sortix os-test. ok deraadt@, millert@
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: mman.h,v 1.35 2022/10/07 14:59:39 deraadt Exp $ */
|
||||
/* $OpenBSD: mman.h,v 1.36 2026/03/26 21:46:24 daniel Exp $ */
|
||||
/* $NetBSD: mman.h,v 1.11 1995/03/26 20:24:23 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
@@ -142,6 +142,11 @@ typedef __size_t size_t;
|
||||
typedef __off_t off_t;
|
||||
#endif
|
||||
|
||||
#ifndef _MODE_T_DEFINED_
|
||||
#define _MODE_T_DEFINED_
|
||||
typedef __mode_t mode_t;
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
void * mmap(void *, size_t, int, int, int, off_t);
|
||||
int mprotect(void *, size_t, int);
|
||||
@@ -158,7 +163,7 @@ int mimmutable(void *, size_t);
|
||||
void * mquery(void *, size_t, int, int, int, off_t);
|
||||
#endif
|
||||
int posix_madvise(void *, size_t, int);
|
||||
int shm_open(const char *, int, __mode_t);
|
||||
int shm_open(const char *, int, mode_t);
|
||||
int shm_unlink(const char *);
|
||||
int shm_mkstemp(char *);
|
||||
__END_DECLS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $ */
|
||||
/* $OpenBSD: types.h,v 1.50 2026/03/26 21:46:24 daniel Exp $ */
|
||||
/* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
@@ -140,7 +140,6 @@ typedef __gid_t gid_t; /* group id */
|
||||
typedef __id_t id_t; /* may contain pid, uid or gid */
|
||||
typedef __ino_t ino_t; /* inode number */
|
||||
typedef __key_t key_t; /* IPC key (for Sys V IPC) */
|
||||
typedef __mode_t mode_t; /* permissions */
|
||||
typedef __nlink_t nlink_t; /* link count */
|
||||
typedef __rlim_t rlim_t; /* resource limit */
|
||||
typedef __segsz_t segsz_t; /* segment size */
|
||||
@@ -193,6 +192,11 @@ typedef __timer_t timer_t;
|
||||
typedef __off_t off_t;
|
||||
#endif
|
||||
|
||||
#ifndef _MODE_T_DEFINED_
|
||||
#define _MODE_T_DEFINED_
|
||||
typedef __mode_t mode_t; /* permissions */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These belong in unistd.h, but are placed here too to ensure that
|
||||
* long arguments will be promoted to off_t if the program fails to
|
||||
|
||||
Reference in New Issue
Block a user