]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/stub/sysd-stdio.c
update from main archive
[thirdparty/glibc.git] / sysdeps / stub / sysd-stdio.c
1 /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
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 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
18
19 #include <errno.h>
20 #include <stdio.h>
21
22
23 /* Read up to N chars into BUF from COOKIE.
24 Return how many chars were read, 0 for EOF or -1 for error. */
25 int
26 __stdio_read (cookie, buf, n)
27 void *cookie;
28 register char *buf;
29 register size_t n;
30 {
31 __set_errno (ENOSYS);
32 return -1;
33 }
34
35 /* Write up to N chars from BUF to COOKIE.
36 Return how many chars were written or -1 for error. */
37 int
38 __stdio_write (cookie, buf, n)
39 void *cookie;
40 register const char *buf;
41 register size_t n;
42 {
43 __set_errno (ENOSYS);
44 return -1;
45 }
46
47 /* Move COOKIE's file position *POS bytes, according to WHENCE.
48 The new file position is stored in *POS.
49 Returns zero if successful, nonzero if not. */
50 int
51 __stdio_seek (cookie, pos, whence)
52 void *cookie;
53 fpos_t *pos;
54 int whence;
55 {
56 __set_errno (ENOSYS);
57 return -1;
58 }
59
60 /* Close the file associated with COOKIE.
61 Return 0 for success or -1 for failure. */
62 int
63 __stdio_close (cookie)
64 void *cookie;
65 {
66 __set_errno (ENOSYS);
67 return -1;
68 }
69
70 /* Return the POSIX.1 file descriptor associated with COOKIE,
71 or -1 for errors. If COOKIE does not relate to any POSIX.1 file
72 descriptor, this should return -1 with errno set to EOPNOTSUPP. */
73 int
74 __stdio_fileno (cookie)
75 void *cookie;
76 {
77 __set_errno (ENOSYS);
78 return -1;
79 }
80
81
82 /* Open FILENAME with the mode in M.
83 Store the magic cookie associated with the opened file in *COOKIEPTR.
84 Return zero on success and nonzero on failure. */
85 int
86 __stdio_open (filename, m, cookieptr)
87 const char *filename;
88 __io_mode m;
89 void **cookieptr;
90 {
91 __set_errno (ENOSYS);
92 return -1;
93 }
94
95
96 /* Open FILENAME with the mode in M. Use the same magic cookie
97 already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN. */
98 int
99 __stdio_reopen (filename, m, cookieptr)
100 const char *filename;
101 __io_mode m;
102 void **cookieptr;
103 __io_close_fn closefn;
104 {
105 __set_errno (ENOSYS);
106 return -1;
107 }
108
109
110 stub_warning (__stdio_read)
111 stub_warning (__stdio_write)
112 stub_warning (__stdio_seek)
113 stub_warning (__stdio_close)
114 stub_warning (__stdio_fileno)
115 stub_warning (__stdio_open)
116 stub_warning (__stdio_reopen)