diff options
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 27 | ||||
-rw-r--r-- | winsup/cygwin/Makefile.in | 6 | ||||
-rwxr-xr-x | winsup/cygwin/cygserver.cc | 2 | ||||
-rwxr-xr-x | winsup/cygwin/cygserver_client.cc | 37 | ||||
-rwxr-xr-x | winsup/cygwin/cygserver_shm.cc | 40 | ||||
-rw-r--r-- | winsup/cygwin/cygserver_shm.h | 2 | ||||
-rwxr-xr-x | winsup/cygwin/include/cygwin/cygserver.h | 11 | ||||
-rw-r--r-- | winsup/cygwin/shm.cc | 24 |
8 files changed, 73 insertions, 76 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e739cf080..b2a822f9e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,30 @@ +Tue Oct 2 16:06:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in: Remove cygserver_shm.o from cygwin1.dll. + Rename cygserver_shm_outside.o to cygserver_shm.o. + * cygserver.cc (server_request::process): Use the new client_request + constructor. + * cygserver_client.cc: Remove the #ifdef's stubs for the server method + within cygwin. + (client_request_attach_tty::client_request_attach_tty): Use the new + client_request constructor. + (client_request_shutdown::client_request_shutdown): Ditto. + (client_request::client_request): Ditto. + * cygserver_shm.cc (client_request_shm_get::serve): Remove the + #ifdef'd stub for in-cygwin builds. + (client_request_shm_get::client_request_shm_get): Use the new + client_request constructor, and remove the in-cygwin variants. + * cygserver_shm.h (class client_request_shm_get): #ifndef test the + serve method - it's only used in cygserver. + * shm.cc (client_request_shm_get::client_request_shm_get): New function. + * include/cygwin/cygserver.h (request_header): New constructor. + (class client_request): Use it. + New constructor accepting the header size. + #ifndef test the server method - it's only used within cygserver. + (client_request_get_version): #ifdef test the server method. + (client_request_shutdown): Ditto. + (client_request_attach_tty): Ditto. + Tue Oct 2 9:57:00 2001 Robert Collins <rbtcollins@hotmail.com> * Makefile.in: add threaded_queue.o to cygserver.exe. diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index fe336afcb..7918c47f8 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -116,7 +116,7 @@ MALLOC_OFILES=@MALLOC_OFILES@ DLL_IMPORTS:=$(w32api_lib)/libkernel32.a -DLL_OFILES:=assert.o autoload.o cygheap.o cygserver_client.o cygserver_shm.o \ +DLL_OFILES:=assert.o autoload.o cygheap.o cygserver_client.o \ cygserver_transport.o cygserver_transport_pipes.o cygserver_transport_sockets.o \ dcrt0.o debug.o \ delqueue.o dir.o \ @@ -236,10 +236,10 @@ cygserver_transport_sockets_outside.o: cygserver_transport_sockets.cc cygserver_client_outside.o: cygserver_client.cc $(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $< -cygserver_shm_outside.o: cygserver_shm.cc +cygserver_shm.o: cygserver_shm.cc $(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $< -cygserver.exe: cygserver.o cygserver_shm_outside.o cygserver_transport_outside.o cygserver_transport_pipes_outside.o cygserver_transport_sockets_outside.o cygserver_client_outside.o cygserver_process.o threaded_queue.o wincap.o version.o smallprint.o +cygserver.exe: cygserver.o cygserver_shm.o cygserver_transport_outside.o cygserver_transport_pipes_outside.o cygserver_transport_sockets_outside.o cygserver_client_outside.o cygserver_process.o threaded_queue.o wincap.o version.o smallprint.o $(CXX) -o $@ $^ #ifdef VERBOSE # $(CXX) $(MINGW_CXXFLAGS) -o $@ ${wordlist 1,3,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS) diff --git a/winsup/cygwin/cygserver.cc b/winsup/cygwin/cygserver.cc index f16a1dfaa..f4e2b852a 100755 --- a/winsup/cygwin/cygserver.cc +++ b/winsup/cygwin/cygserver.cc @@ -372,7 +372,7 @@ server_request::process () case CYGSERVER_REQUEST_SHM_GET: req = new client_request_shm_get (); break; default: - req = new client_request (CYGSERVER_REQUEST_INVALID); + req = new client_request (CYGSERVER_REQUEST_INVALID, 0); req->header.error_code = ENOSYS; debug_printf ("Bad client request - returning ENOSYS\n"); } diff --git a/winsup/cygwin/cygserver_client.cc b/winsup/cygwin/cygserver_client.cc index ef9b87067..083619351 100755 --- a/winsup/cygwin/cygserver_client.cc +++ b/winsup/cygwin/cygserver_client.cc @@ -34,22 +34,13 @@ /* 0 = untested, 1 = running, 2 = dead */ int cygserver_running=CYGSERVER_UNKNOWN; -client_request_get_version::client_request_get_version () : client_request (CYGSERVER_REQUEST_GET_VERSION) +client_request_get_version::client_request_get_version () : client_request (CYGSERVER_REQUEST_GET_VERSION, sizeof (version)) { - header.cb = sizeof (version); buffer = (char *)&version; } -#ifdef __INSIDE_CYGWIN__ -void -client_request_get_version::serve (transport_layer_base *conn, class process_cache *cache) -{ -} -#endif - -client_request_attach_tty::client_request_attach_tty () : client_request (CYGSERVER_REQUEST_ATTACH_TTY) +client_request_attach_tty::client_request_attach_tty () : client_request (CYGSERVER_REQUEST_ATTACH_TTY, sizeof (req)) { - header.cb = sizeof (req); buffer = (char *)&req; req.pid = 0; req.master_pid = 0; @@ -57,9 +48,8 @@ client_request_attach_tty::client_request_attach_tty () : client_request (CYGSER req.to_master = NULL; } -client_request_attach_tty::client_request_attach_tty (DWORD npid, DWORD nmaster_pid, HANDLE nfrom_master, HANDLE nto_master) : client_request (CYGSERVER_REQUEST_ATTACH_TTY) +client_request_attach_tty::client_request_attach_tty (DWORD npid, DWORD nmaster_pid, HANDLE nfrom_master, HANDLE nto_master) : client_request (CYGSERVER_REQUEST_ATTACH_TTY, sizeof (req)) { - header.cb = sizeof (req); buffer = (char *)&req; req.pid = npid; req.master_pid = nmaster_pid; @@ -67,30 +57,13 @@ client_request_attach_tty::client_request_attach_tty (DWORD npid, DWORD nmaster_ req.to_master = nto_master; } -#ifdef __INSIDE_CYGWIN__ -void -client_request_attach_tty::serve (transport_layer_base *conn, class process_cache *cache) +client_request_shutdown::client_request_shutdown () : client_request (CYGSERVER_REQUEST_SHUTDOWN, 0) { -} -#endif - -client_request_shutdown::client_request_shutdown () : client_request (CYGSERVER_REQUEST_SHUTDOWN) -{ - header.cb = 0; buffer = NULL; } -#ifdef __INSIDE_CYGWIN__ -void -client_request_shutdown::serve (transport_layer_base *conn, class process_cache *cache) -{ -} -#endif - -client_request::client_request (cygserver_request_code id) +client_request::client_request (cygserver_request_code id, ssize_t buffer_size) : header (id, buffer_size) { - header.req_id = id; - header.error_code = 0; } client_request::~client_request () diff --git a/winsup/cygwin/cygserver_shm.cc b/winsup/cygwin/cygserver_shm.cc index 3b8bd9dd2..491b01744 100755 --- a/winsup/cygwin/cygserver_shm.cc +++ b/winsup/cygwin/cygserver_shm.cc @@ -68,38 +68,10 @@ getsystemallocgranularity () return buffer_offset; } -client_request_shm_get::client_request_shm_get ():client_request (CYGSERVER_REQUEST_SHM_GET) -{ - header.cb = sizeof (parameters); - buffer = (char *) ¶meters; - header.error_code = 0; -} - -client_request_shm_get::client_request_shm_get (int nshm_id, pid_t npid): -client_request (CYGSERVER_REQUEST_SHM_GET) -{ - header.cb = sizeof (parameters); - buffer = (char *) ¶meters; - header.error_code = 0; - parameters.in.shm_id = nshm_id; - parameters.in.type = SHM_REATTACH; - parameters.in.pid = npid; -} -client_request_shm_get::client_request_shm_get (key_t nkey, size_t nsize, - int nshmflg, - char psdbuf[4096], - pid_t npid): -client_request (CYGSERVER_REQUEST_SHM_GET) +client_request_shm_get::client_request_shm_get ():client_request (CYGSERVER_REQUEST_SHM_GET, sizeof (parameters)) { - header.cb = sizeof (parameters); buffer = (char *) ¶meters; - parameters.in.key = nkey; - parameters.in.size = nsize; - parameters.in.shmflg = nshmflg; - parameters.in.type = SHM_CREATE; - parameters.in.pid = npid; - memcpy (parameters.in.sd_buf, psdbuf, 4096); } /* FIXME: If building on a 64-bit compiler, the address->int typecast will fail. @@ -163,15 +135,6 @@ shmat (int shmid, const void *shmaddr, int parameters.in.shmflg) /* FIXME: on NT we should check everything against the SD. On 95 we just emulate. */ -/* for dll size */ -#ifdef __INSIDE_CYGWIN__ -void -client_request_shm_get::serve (transport_layer_base * conn, - process_cache * cache) -{ -} -#else - extern GENERIC_MAPPING access_mapping; extern int @@ -559,4 +522,3 @@ client_request_shm_get::serve (transport_layer_base * conn, CloseHandle (token_handle); return; } -#endif diff --git a/winsup/cygwin/cygserver_shm.h b/winsup/cygwin/cygserver_shm.h index 25f747fb0..20d5e5db9 100644 --- a/winsup/cygwin/cygserver_shm.h +++ b/winsup/cygwin/cygserver_shm.h @@ -20,7 +20,9 @@ details. */ class client_request_shm_get : public client_request { public: +#ifndef __INSIDE_CYGWIN__ virtual void serve (transport_layer_base *conn, process_cache *cache); +#endif client_request_shm_get::client_request_shm_get(key_t, size_t, int, char psdbuf[4096], pid_t); client_request_shm_get::client_request_shm_get(); client_request_shm_get::client_request_shm_get(int,pid_t); diff --git a/winsup/cygwin/include/cygwin/cygserver.h b/winsup/cygwin/include/cygwin/cygserver.h index ad7dd3ce3..3751863f5 100755 --- a/winsup/cygwin/include/cygwin/cygserver.h +++ b/winsup/cygwin/include/cygwin/cygserver.h @@ -42,6 +42,7 @@ class request_header ssize_t cb; cygserver_request_code req_id; ssize_t error_code; + request_header (cygserver_request_code id, ssize_t ncb) : cb (ncb), req_id (id), error_code (0) {} ; } #ifdef __GNUC__ __attribute__ ((packed)) @@ -85,9 +86,11 @@ struct request_attach_tty class client_request { public: - client_request (cygserver_request_code id); + client_request (cygserver_request_code id, ssize_t data_size); virtual void send (transport_layer_base *conn); +#ifndef __INSIDE_CYGWIN__ virtual void serve (transport_layer_base *conn, class process_cache *cache); +#endif virtual operator struct request_header (); cygserver_request_code req_id () {return header.req_id;}; virtual ~client_request(); @@ -98,7 +101,9 @@ class client_request class client_request_get_version : public client_request { public: +#ifndef __INSIDE_CYGWIN__ virtual void serve (transport_layer_base *conn, class process_cache *cache); +#endif client_request_get_version::client_request_get_version(); struct request_get_version version; }; @@ -106,14 +111,18 @@ class client_request_get_version : public client_request class client_request_shutdown : public client_request { public: +#ifndef __INSIDE_CYGWIN__ virtual void serve (transport_layer_base *conn, class process_cache *cache); +#endif client_request_shutdown (); }; class client_request_attach_tty : public client_request { public: +#ifndef __INSIDE_CYGWIN__ virtual void serve (transport_layer_base *conn, class process_cache *cache); +#endif client_request_attach_tty (); client_request_attach_tty (DWORD npid, DWORD nmaster_pid, HANDLE nfrom_master, HANDLE nto_master); HANDLE from_master () {return req.from_master;}; diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc index 2caad7376..0d8597281 100644 --- a/winsup/cygwin/shm.cc +++ b/winsup/cygwin/shm.cc @@ -44,6 +44,30 @@ getsystemallocgranularity () return buffer_offset; } +client_request_shm_get::client_request_shm_get (int nshm_id, pid_t npid): +client_request (CYGSERVER_REQUEST_SHM_GET, sizeof (parameters)) +{ + buffer = (char *) ¶meters; + parameters.in.shm_id = nshm_id; + parameters.in.type = SHM_REATTACH; + parameters.in.pid = npid; +} + +client_request_shm_get::client_request_shm_get (key_t nkey, size_t nsize, + int nshmflg, + char psdbuf[4096], + pid_t npid): +client_request (CYGSERVER_REQUEST_SHM_GET, sizeof (parameters)) +{ + buffer = (char *) ¶meters; + parameters.in.key = nkey; + parameters.in.size = nsize; + parameters.in.shmflg = nshmflg; + parameters.in.type = SHM_CREATE; + parameters.in.pid = npid; + memcpy (parameters.in.sd_buf, psdbuf, 4096); +} + static shmnode *shm_head = NULL; static shmnode * |