include/ansidecl.h: import from binutils-gdb
[newlib-cygwin.git] / winsup / cygserver / transport_pipes.h
blobe101623d24d5e177811776b1ce9b04806a425e76
1 /* transport_pipes.h
3 Written by Robert Collins <rbtcollins@hotmail.com>
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9 details. */
11 #ifndef _TRANSPORT_PIPES_H
12 #define _TRANSPORT_PIPES_H
14 #define PIPE_NAME_PREFIX L"\\\\.\\pipe\\cygwin-"
15 #define PIPE_NAME_SUFFIX L"-lpc"
17 /* Named pipes based transport, for security on NT */
18 class transport_layer_pipes : public transport_layer_base
20 public:
21 #ifndef __INSIDE_CYGWIN__
22 virtual int listen ();
23 virtual class transport_layer_pipes *accept (bool *recoverable);
24 #endif
26 virtual void close ();
27 virtual ssize_t read (void *buf, size_t len);
28 virtual ssize_t write (void *buf, size_t len);
29 virtual int connect ();
31 #ifndef __INSIDE_CYGWIN__
32 virtual bool impersonate_client ();
33 virtual bool revert_to_self ();
34 #endif
36 transport_layer_pipes ();
37 virtual ~transport_layer_pipes ();
39 private:
40 wchar_t _pipe_name[40];
41 HANDLE _hPipe;
42 const bool _is_accepted_endpoint;
43 bool _is_listening_endpoint;
45 transport_layer_pipes (HANDLE hPipe);
48 #endif /* _TRANSPORT_PIPES_H */