stropts.h 3.0 KB

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