diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-02-14 10:06:46 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-02-14 10:06:46 +0000 |
commit | 7b487ba942079101fdedf8fced7a6d90c2c62b0b (patch) | |
tree | a93007d0b748360f3e48d5c3268a17dd98c6d4c6 /winsup/cygwin/syscalls.cc | |
parent | 77da924b40fd4396e88df54bf6dc5d01db0907ee (diff) | |
download | cygnal-7b487ba942079101fdedf8fced7a6d90c2c62b0b.tar.gz cygnal-7b487ba942079101fdedf8fced7a6d90c2c62b0b.tar.bz2 cygnal-7b487ba942079101fdedf8fced7a6d90c2c62b0b.zip |
* Makefile.in (DLL_OFILES): Add posix_ipc.o.
* cygwin.din (mq_close): Export.
(mq_getattr): Export.
(mq_notify): Export.
(mq_open): Export.
(mq_receive): Export.
(mq_send): Export.
(mq_setattr): Export.
(mq_timedreceive): Export.
(mq_timedsend): Export.
(mq_unlink): Export.
* posix_ipc.cc: New file implementing the above functions. Move
shm_open and shm_unlink from syscalls.cc here.
* sysconf.cc (sca): Set value of _SC_MQ_OPEN_MAX to MQ_OPEN_MAX,
_SC_MQ_PRIO_MAX to MQ_PRIO_MAX, _SC_MESSAGE_PASSING to
_POSIX_MESSAGE_PASSING.
* include/limits.h (MQ_OPEN_MAX): Define.
(MQ_PRIO_MAX): Define.
* include/mqueue.h: New file.
* include/cygwin/version.h: Bump API minor number.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 855ff43cc..6a0e45fb5 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -3346,73 +3346,3 @@ pclose (FILE *fp) return status; } - -#define SHM_STORAGE "/dev/shm" - -static bool -check_shm (const char *name) -{ - /* Note that we require the existance of /dev/shm for shared memory - object support, same as on Linux. We don't create this directory - here, that's the task of the installer. But we check for existance - and give ample warning. */ - path_conv dev_shm (SHM_STORAGE, PC_SYM_NOFOLLOW); - if (dev_shm.error || !dev_shm.exists () || !dev_shm.isdir ()) - { - small_printf ( - "Warning: '%s' does not exists or is not a directory.\n\n" - "Shared memory objects require the existance of this directory.\n" - "Create the directory '%s' and set the permissions to 01777.\n" - "For instance on the command line: mkdir -m 01777 %s\n", - SHM_STORAGE, SHM_STORAGE, SHM_STORAGE); - set_errno (EINVAL); - return false; - } - /* Name must start with a single slash. */ - if (!name || name[0] != '/' || name[1] == '/') - { - debug_printf ("Invalid shared memory object name '%s'", name); - set_errno (EINVAL); - return false; - } - if (strlen (name) > CYG_MAX_PATH - sizeof (SHM_STORAGE)) - { - debug_printf ("shared memory object name '%s' too long", name); - set_errno (ENAMETOOLONG); - return false; - } - return true; -} - -extern "C" int -shm_open (const char *name, int oflag, mode_t mode) -{ - if (!check_shm (name)) - return -1; - - /* Check for valid flags. */ - if (((oflag & O_ACCMODE) != O_RDONLY && (oflag & O_ACCMODE) != O_RDWR) - || (oflag & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC))) - { - debug_printf ("Invalid oflag 0%o", oflag); - set_errno (EINVAL); - return -1; - } - - char shmname[CYG_MAX_PATH]; - strcpy (shmname, SHM_STORAGE); - strcat (shmname, name); - return open (shmname, oflag, mode & 0777); -} - -extern "C" int -shm_unlink (const char *name) -{ - if (!check_shm (name)) - return -1; - - char shmname[CYG_MAX_PATH]; - strcpy (shmname, SHM_STORAGE); - strcat (shmname, name); - return unlink (shmname); -} |