Hurd: empty file names fail with ENOENT
[glibc.git] / streams / stropts.h
blob80fe460b77ada00e5dfe393b5fb637724b45661c
1 /* Copyright (C) 1998-2000, 2002, 2003, 2012 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
18 #ifndef _STROPTS_H
19 #define _STROPTS_H 1
21 #include <features.h>
22 #include <bits/types.h>
23 #include <bits/xtitypes.h>
25 #ifndef __gid_t_defined
26 typedef __gid_t gid_t;
27 # define __gid_t_defined
28 #endif
30 #ifndef __uid_t_defined
31 typedef __uid_t uid_t;
32 # define __uid_t_defined
33 #endif
35 typedef __t_uscalar_t t_uscalar_t;
37 /* Get system specific contants. */
38 #include <bits/stropts.h>
41 __BEGIN_DECLS
43 /* Test whether FILDES is associated with a STREAM-based file. */
44 extern int isastream (int __fildes) __THROW;
46 /* Receive next message from a STREAMS file.
48 This function is a cancellation point and therefore not marked with
49 __THROW. */
50 extern int getmsg (int __fildes, struct strbuf *__restrict __ctlptr,
51 struct strbuf *__restrict __dataptr,
52 int *__restrict __flagsp);
54 /* Receive next message from a STREAMS file, with *FLAGSP allowing to
55 control which message.
57 This function is a cancellation point and therefore not marked with
58 __THROW. */
59 extern int getpmsg (int __fildes, struct strbuf *__restrict __ctlptr,
60 struct strbuf *__restrict __dataptr,
61 int *__restrict __bandp, int *__restrict __flagsp);
63 /* Perform the I/O control operation specified by REQUEST on FD.
64 One argument may follow; its presence and type depend on REQUEST.
65 Return value depends on REQUEST. Usually -1 indicates error. */
66 extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
68 /* Send a message on a STREAM.
70 This function is a cancellation point and therefore not marked with
71 __THROW. */
72 extern int putmsg (int __fildes, const struct strbuf *__ctlptr,
73 const struct strbuf *__dataptr, int __flags);
75 /* Send a message on a STREAM to the BAND.
77 This function is a cancellation point and therefore not marked with
78 __THROW. */
79 extern int putpmsg (int __fildes, const struct strbuf *__ctlptr,
80 const struct strbuf *__dataptr, int __band, int __flags);
82 /* Attach a STREAMS-based file descriptor FILDES to a file PATH in the
83 file system name space. */
84 extern int fattach (int __fildes, const char *__path) __THROW;
86 /* Detach a name PATH from a STREAMS-based file descriptor. */
87 extern int fdetach (const char *__path) __THROW;
89 __END_DECLS
91 #endif /* stropts.h */