1 /* No user fns here. Pesch 15apr92. */
4 * Copyright (c) 1990 The Regents of the University of California.
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by the University of California, Berkeley. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 #include <sys/types.h>
23 #include <sys/unistd.h>
27 #ifdef __LARGE64_FILES
29 __sseek64_r (ptr
, cookie
, offset
, whence
)
35 register FILE *fp
= (FILE *) cookie
;
36 register _off64_t ret
;
38 ret
= _lseek64_r (ptr
, fp
->_file
, (_off64_t
) offset
, whence
);
39 if (ret
== (_fpos64_t
)-1L)
40 fp
->_flags
&= ~__SOFF
;
49 _READ_WRITE_RETURN_TYPE
50 __swrite64_r (ptr
, cookie
, buf
, n
)
56 register FILE *fp
= (FILE *) cookie
;
62 if (fp
->_flags
& __SAPP
)
63 (void) _lseek64_r (ptr
, fp
->_file
, (_off64_t
)0, SEEK_END
);
64 fp
->_flags
&= ~__SOFF
; /* in case O_APPEND mode is set */
67 if (fp
->_flags
& __SCLE
)
68 oldmode
= setmode(fp
->_file
, O_BINARY
);
71 w
= _write_r (ptr
, fp
->_file
, buf
, n
);
75 setmode(fp
->_file
, oldmode
);
83 __sseek64 (cookie
, offset
, whence
)
88 return __sseek64_r (_REENT
, cookie
, offset
, whence
);
91 _READ_WRITE_RETURN_TYPE
92 __swrite64 (cookie
, buf
, n
)
97 return __swrite64_r (_REENT
, cookie
, buf
, n
);
100 #endif /* !_REENT_ONLY */
102 #endif /* __LARGE64_FILES */