*** empty log message ***
[glibc.git] / libio / ioprims.c
blobd17c10a1681bb537f1298cca50b3bd579da80dec
1 /*
2 Copyright (C) 1993 Free Software Foundation
4 This file is part of the GNU IO Library. This library is free
5 software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 This 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNU CC; see the file COPYING. If not, write to
17 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 As a special exception, if you link this library with files
20 compiled with a GNU compiler to produce an executable, this does not cause
21 the resulting executable to be covered by the GNU General Public License.
22 This exception does not however invalidate any other reasons why
23 the executable file might be covered by the GNU General Public License. */
25 /* I/O OS-level primitives.
26 Needs to be replaced if not using Unix.
27 Also needs to be replaced if avoiding name-space pollution
28 (in which case read would be defined in terms of _IO_read,
29 rather than vice versa). */
31 #include "libioP.h"
32 #include <unistd.h>
33 #include <sys/types.h>
34 #include <sys/stat.h>
36 #ifdef TODO
37 /* Add open, isatty */
38 #endif
40 _IO_ssize_t
41 DEFUN(_IO_read, (fildes, buf, nbyte),
42 int fildes AND void *buf AND _IO_size_t nbyte)
44 return __read (fildes, buf, nbyte);
47 _IO_ssize_t
48 DEFUN(_IO_write, (fildes, buf, nbyte),
49 int fildes AND const void *buf AND _IO_size_t nbyte)
51 return __write (fildes, buf, nbyte);
54 _IO_off_t
55 DEFUN(_IO_lseek, (fildes, offset, whence),
56 int fildes AND _IO_off_t offset AND int whence)
58 return __lseek (fildes, offset, whence);
61 int
62 DEFUN(_IO_close, (fildes),
63 int fildes)
65 return __close (fildes);
68 int
69 DEFUN(_IO_fstat, (fildes, buf),
70 int fildes AND struct stat *buf)
72 return __fstat (fildes, buf);