* Makefile.in: Add $(LIBSERVER) rule.
* cygserver.h: Moved from include/cygwin to here. * cygserver_ipc.h: Moved from ../cygserver to here. * cygserver_shm.h: Ditto. * cygwin.din: Add shmat, shmctl, shmdt and shmget. * fhandler_tty.cc (fhandler_tty_slave::open): Don't warn about handle dup'ing if not build with USE_SERVER. * shm.cc: Include cygerrno.h unconditionally. (shmat): Set errno to ENOSYS and return -1 if not build with USE_SERVER. (shmctl): Ditto. (shmdt): Ditto. (shmget): Ditto. * woutsup.h: Remove. * include/cygwin/cygserver_process.h: Moved to ../cygserver directory. * include/cygwin/cygserver_transport.h: Ditto. * include/cygwin/cygserver_transport_pipes.h: Ditto. * include/cygwin/cygserver_transport_sockets.h: Ditto. * include/cygwin/version.h: Bump API minor number.
This commit is contained in:
@@ -12,6 +12,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "cygerrno.h"
|
||||
#ifdef USE_SERVER
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -19,7 +20,6 @@ details. */
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "cygerrno.h"
|
||||
#include "safe_memory.h"
|
||||
#include "sigproc.h"
|
||||
|
||||
@@ -551,50 +551,6 @@ client_shmmgr::new_segment (const int shmid,
|
||||
return segptr;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmat ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" void *
|
||||
shmat (const int shmid, const void *const shmaddr, const int shmflg)
|
||||
{
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmat (shmid, shmaddr, shmflg);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmctl ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" int
|
||||
shmctl (const int shmid, const int cmd, struct shmid_ds *const buf)
|
||||
{
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmctl (shmid, cmd, buf);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmdt ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" int
|
||||
shmdt (const void *const shmaddr)
|
||||
{
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmdt (shmaddr);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmget ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" int
|
||||
shmget (const key_t key, const size_t size, const int shmflg)
|
||||
{
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmget (key, size, shmflg);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* fixup_shms_after_fork ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
@@ -691,3 +647,67 @@ client_request_shm::client_request_shm (const key_t key,
|
||||
msglen (sizeof (_parameters.in));
|
||||
}
|
||||
#endif /* USE_SERVER */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmat ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" void *
|
||||
shmat (const int shmid, const void *const shmaddr, const int shmflg)
|
||||
{
|
||||
#ifdef USE_SERVER
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmat (shmid, shmaddr, shmflg);
|
||||
#else
|
||||
set_errno (ENOSYS);
|
||||
return (void *) -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmctl ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" int
|
||||
shmctl (const int shmid, const int cmd, struct shmid_ds *const buf)
|
||||
{
|
||||
#ifdef USE_SERVER
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmctl (shmid, cmd, buf);
|
||||
#else
|
||||
set_errno (ENOSYS);
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmdt ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" int
|
||||
shmdt (const void *const shmaddr)
|
||||
{
|
||||
#ifdef USE_SERVER
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmdt (shmaddr);
|
||||
#else
|
||||
set_errno (ENOSYS);
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* shmget ()
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern "C" int
|
||||
shmget (const key_t key, const size_t size, const int shmflg)
|
||||
{
|
||||
#ifdef USE_SERVER
|
||||
sigframe thisframe (mainthread);
|
||||
return shmmgr.shmget (key, size, shmflg);
|
||||
#else
|
||||
set_errno (ENOSYS);
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user