(root)/
glibc-2.38/
posix/
streams-compat.c
       1  /* Compatibility symbols for the unimplemented XSI STREAMS extension.
       2     Copyright (C) 1998-2023 Free Software Foundation, Inc.
       3     This file is part of the GNU C Library.
       4  
       5     The GNU C Library is free software; you can redistribute it and/or
       6     modify it under the terms of the GNU Lesser General Public
       7     License as published by the Free Software Foundation; either
       8     version 2.1 of the License, or (at your option) any later version.
       9  
      10     The GNU C Library is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13     Lesser General Public License for more details.
      14  
      15     You should have received a copy of the GNU Lesser General Public
      16     License along with the GNU C Library; if not, see
      17     <https://www.gnu.org/licenses/>.  */
      18  
      19  #include <shlib-compat.h>
      20  
      21  #if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_30)
      22  
      23  # include <errno.h>
      24  # include <fcntl.h>
      25  
      26  struct strbuf;
      27  
      28  int
      29  attribute_compat_text_section
      30  fattach (int fildes, const char *path)
      31  {
      32    __set_errno (ENOSYS);
      33    return -1;
      34  }
      35  compat_symbol (libc, fattach, fattach, GLIBC_2_1);
      36  
      37  int
      38  attribute_compat_text_section
      39  fdetach (const char *path)
      40  {
      41    __set_errno (ENOSYS);
      42    return -1;
      43  }
      44  compat_symbol (libc, fdetach, fdetach, GLIBC_2_1);
      45  
      46  
      47  int
      48  attribute_compat_text_section
      49  getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
      50  {
      51    __set_errno (ENOSYS);
      52    return -1;
      53  }
      54  compat_symbol (libc, getmsg, getmsg, GLIBC_2_1);
      55  
      56  int
      57  attribute_compat_text_section
      58  getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
      59  	 int *flagsp)
      60  {
      61    __set_errno (ENOSYS);
      62    return -1;
      63  }
      64  compat_symbol (libc, getpmsg, getpmsg, GLIBC_2_1);
      65  
      66  int
      67  attribute_compat_text_section
      68  isastream (int fildes)
      69  {
      70    /* In general we do not have a STREAMS implementation and therefore
      71       return 0.  But for invalid file descriptors we have to return an
      72       error.  */
      73    if (__fcntl (fildes, F_GETFD) < 0)
      74      return -1;
      75  
      76    /* No STREAM.  */
      77    return 0;
      78  }
      79  compat_symbol (libc, isastream, isastream, GLIBC_2_1);
      80  
      81  int
      82  attribute_compat_text_section
      83  putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
      84  	int flags)
      85  {
      86    __set_errno (ENOSYS);
      87    return -1;
      88  }
      89  compat_symbol (libc, putmsg, putmsg, GLIBC_2_1);
      90  
      91  int
      92  attribute_compat_text_section
      93  putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
      94  	 int band, int flags)
      95  {
      96    __set_errno (ENOSYS);
      97    return -1;
      98  }
      99  compat_symbol (libc, putpmsg, putpmsg, GLIBC_2_1);
     100  
     101  #endif /* SHLIB_COMPAT */