changed system-calls to avoid namespace pollution
This commit is contained in:
parent
67f0c95888
commit
90819543f6
16 changed files with 80 additions and 70 deletions
|
@ -240,12 +240,14 @@ _doscan(register FILE *stream, const char *format, va_list ap)
|
||||||
case 'n':
|
case 'n':
|
||||||
if (ic != EOF) ungetc(ic, stream);
|
if (ic != EOF) ungetc(ic, stream);
|
||||||
nrchars--;
|
nrchars--;
|
||||||
if (flags & FL_SHORT)
|
if (!(flags & FL_NOASSIGN)) {
|
||||||
*va_arg(ap, short *) = (short) nrchars;
|
if (flags & FL_SHORT)
|
||||||
else if (flags & FL_LONG)
|
*va_arg(ap, short *) = (short) nrchars;
|
||||||
*va_arg(ap, long *) = (long) nrchars;
|
else if (flags & FL_LONG)
|
||||||
else
|
*va_arg(ap, long *) = (long) nrchars;
|
||||||
*va_arg(ap, int *) = (int) nrchars;
|
else
|
||||||
|
*va_arg(ap, int *) = (int) nrchars;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'b': /* binary */
|
case 'b': /* binary */
|
||||||
case 'd': /* decimal */
|
case 'd': /* decimal */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "loc_incl.h"
|
#include "loc_incl.h"
|
||||||
|
|
||||||
int close(int d);
|
int _close(int d);
|
||||||
|
|
||||||
int
|
int
|
||||||
fclose(FILE *fp)
|
fclose(FILE *fp)
|
||||||
|
@ -22,7 +22,7 @@ fclose(FILE *fp)
|
||||||
if (i >= FOPEN_MAX)
|
if (i >= FOPEN_MAX)
|
||||||
return EOF;
|
return EOF;
|
||||||
if (fflush(fp)) retval = EOF;
|
if (fflush(fp)) retval = EOF;
|
||||||
if (close(fileno(fp))) retval = EOF;
|
if (_close(fileno(fp))) retval = EOF;
|
||||||
if ( io_testflag(fp,_IOMYBUF) && fp->_buf )
|
if ( io_testflag(fp,_IOMYBUF) && fp->_buf )
|
||||||
free((void *)fp->_buf);
|
free((void *)fp->_buf);
|
||||||
if (fp != stdin && fp != stdout && fp != stderr)
|
if (fp != stdin && fp != stdout && fp != stderr)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "loc_incl.h"
|
#include "loc_incl.h"
|
||||||
|
|
||||||
int write(int d, const char *buf, int nbytes);
|
int _write(int d, const char *buf, int nbytes);
|
||||||
|
|
||||||
int
|
int
|
||||||
fflush(FILE *stream)
|
fflush(FILE *stream)
|
||||||
|
@ -21,38 +21,46 @@ fflush(FILE *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stream->_buf
|
if (!stream->_buf
|
||||||
|| io_testflag(stream, _IONBF)
|
|| (!io_testflag(_IOREADING)
|
||||||
|| !io_testflag(stream, _IOWRITE)
|
&& !io_testflag(_IOWRITING)))
|
||||||
|| !io_testflag(stream, _IOWRITING))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
if (io_testflag(stream, _IOREADING)) {
|
||||||
|
(void) fseek(stream, 0L, SEEK_CUR);
|
||||||
|
return 0;
|
||||||
|
} else if (io_testflag(stream, _IONBF)) return 0;
|
||||||
|
|
||||||
if (io_testflag(stream, _IOREAD)) /* "a" or "+" mode */
|
if (io_testflag(stream, _IOREAD)) /* "a" or "+" mode */
|
||||||
stream->_flags &= ~_IOWRITING;
|
stream->_flags &= ~_IOWRITING;
|
||||||
|
|
||||||
/*
|
|
||||||
if (io_testflag(stream, _IOLBF))
|
|
||||||
count = -stream->_count;
|
|
||||||
else count = stream->_bufsiz - stream->_count;
|
|
||||||
*/
|
|
||||||
count = stream->_ptr - stream->_buf;
|
count = stream->_ptr - stream->_buf;
|
||||||
stream->_ptr = stream->_buf;
|
stream->_ptr = stream->_buf;
|
||||||
|
|
||||||
if ( count <= 0 )
|
if ( count <= 0 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
c1 = write(stream->_fd, (char *)stream->_buf, count);
|
if (io_testflag(stream, _IOAPPEND)) {
|
||||||
|
if (lseek(fileno(stream), 0L, SEEK_END) == -1) {
|
||||||
|
stream->_flags |= _IOERR;
|
||||||
|
return EOF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c1 = _write(stream->_fd, (char *)stream->_buf, count);
|
||||||
|
|
||||||
stream->_count = 0;
|
stream->_count = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
if(stream != stderr)
|
|
||||||
fprintf(stderr,"written %d bytes :\"%.*s\"\n"
|
|
||||||
, c1, c1, stream->_buf);
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( count == c1 )
|
if ( count == c1 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
__cleanup(void)
|
||||||
|
{
|
||||||
|
register int i;
|
||||||
|
|
||||||
|
for(i= 0; i < FOPEN_MAX; i++)
|
||||||
|
if (__iotab[i] && io_testflag(__iotab[i], _IOWRITING))
|
||||||
|
(void) fflush(__iotab[i]);
|
||||||
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "loc_incl.h"
|
#include "loc_incl.h"
|
||||||
|
|
||||||
int read(int d, char *buf, int nbytes);
|
int _read(int d, char *buf, int nbytes);
|
||||||
|
|
||||||
int
|
int
|
||||||
__fillbuf(register FILE *stream)
|
__fillbuf(register FILE *stream)
|
||||||
|
@ -47,7 +47,7 @@ __fillbuf(register FILE *stream)
|
||||||
stream->_bufsiz = 1;
|
stream->_bufsiz = 1;
|
||||||
}
|
}
|
||||||
stream->_ptr = stream->_buf;
|
stream->_ptr = stream->_buf;
|
||||||
stream->_count = read(stream->_fd, (char *)stream->_buf, stream->_bufsiz);
|
stream->_count = _read(stream->_fd, (char *)stream->_buf, stream->_bufsiz);
|
||||||
|
|
||||||
if (stream->_count <= 0){
|
if (stream->_count <= 0){
|
||||||
if (stream->_count == 0) {
|
if (stream->_count == 0) {
|
||||||
|
|
|
@ -9,15 +9,15 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
off_t lseek(int fildes, off_t offset, int whence);
|
off_t _lseek(int fildes, off_t offset, int whence);
|
||||||
int write(int d, const char *buf, int nbytes);
|
int _write(int d, const char *buf, int nbytes);
|
||||||
int isatty(int d);
|
int _isatty(int d);
|
||||||
extern int (*_fflush)(FILE *stream);
|
extern void (*_clean)(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
__flushbuf(int c, FILE * stream)
|
__flushbuf(int c, FILE * stream)
|
||||||
{
|
{
|
||||||
_fflush = fflush;
|
_clean = __cleanup;
|
||||||
if (fileno(stream) < 0) return EOF;
|
if (fileno(stream) < 0) return EOF;
|
||||||
if (!io_testflag(stream, _IOWRITE)) return EOF;
|
if (!io_testflag(stream, _IOWRITE)) return EOF;
|
||||||
if (io_testflag(stream, _IOREADING) && !feof(stream)) return EOF;
|
if (io_testflag(stream, _IOREADING) && !feof(stream)) return EOF;
|
||||||
|
@ -26,7 +26,7 @@ __flushbuf(int c, FILE * stream)
|
||||||
stream->_flags |= _IOWRITING;
|
stream->_flags |= _IOWRITING;
|
||||||
if (!io_testflag(stream, _IONBF)) {
|
if (!io_testflag(stream, _IONBF)) {
|
||||||
if (!stream->_buf) {
|
if (!stream->_buf) {
|
||||||
if (stream == stdout && isatty(fileno(stdout))) {
|
if (stream == stdout && _isatty(fileno(stdout))) {
|
||||||
if (!(stream->_buf =
|
if (!(stream->_buf =
|
||||||
(unsigned char *) malloc(BUFSIZ))) {
|
(unsigned char *) malloc(BUFSIZ))) {
|
||||||
stream->_flags |= _IONBF;
|
stream->_flags |= _IONBF;
|
||||||
|
@ -55,12 +55,12 @@ __flushbuf(int c, FILE * stream)
|
||||||
|
|
||||||
stream->_count = 0;
|
stream->_count = 0;
|
||||||
if (io_testflag(stream, _IOAPPEND)) {
|
if (io_testflag(stream, _IOAPPEND)) {
|
||||||
if (lseek(fileno(stream), 0L, 2) == -1) {
|
if (_lseek(fileno(stream), 0L, SEEK_END) == -1) {
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (write(fileno(stream), &c1, 1) != 1) {
|
if (_write(fileno(stream), &c1, 1) != 1) {
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
@ -69,12 +69,12 @@ __flushbuf(int c, FILE * stream)
|
||||||
*stream->_ptr++ = c;
|
*stream->_ptr++ = c;
|
||||||
if (c == '\n' || stream->_count == -stream->_bufsiz) {
|
if (c == '\n' || stream->_count == -stream->_bufsiz) {
|
||||||
if (io_testflag(stream, _IOAPPEND)) {
|
if (io_testflag(stream, _IOAPPEND)) {
|
||||||
if (lseek(fileno(stream), 0L, 2) == -1) {
|
if (_lseek(fileno(stream), 0L, SEEK_END) == -1) {
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (write(fileno(stream), (char *)stream->_buf,
|
if (_write(fileno(stream), (char *)stream->_buf,
|
||||||
-stream->_count) != -stream->_count) {
|
-stream->_count) != -stream->_count) {
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
return EOF;
|
return EOF;
|
||||||
|
@ -91,12 +91,12 @@ __flushbuf(int c, FILE * stream)
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
if (io_testflag(stream, _IOAPPEND)) {
|
if (io_testflag(stream, _IOAPPEND)) {
|
||||||
if (lseek(fileno(stream), 0L, 2) == -1) {
|
if (_lseek(fileno(stream), 0L, SEEK_END) == -1) {
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (write(fileno(stream), (char *)stream->_buf, count)
|
if (_write(fileno(stream), (char *)stream->_buf, count)
|
||||||
!= count) {
|
!= count) {
|
||||||
*(stream->_buf) = c;
|
*(stream->_buf) = c;
|
||||||
stream->_flags |= _IOERR;
|
stream->_flags |= _IOERR;
|
||||||
|
|
|
@ -35,10 +35,10 @@
|
||||||
#define O_TRUNC 0x020
|
#define O_TRUNC 0x020
|
||||||
#define O_APPEND 0x040
|
#define O_APPEND 0x040
|
||||||
|
|
||||||
int open(const char *path, int flags);
|
int _open(const char *path, int flags);
|
||||||
int creat(const char *path, int mode);
|
int _creat(const char *path, int mode);
|
||||||
|
|
||||||
int close(int d);
|
int _close(int d);
|
||||||
|
|
||||||
FILE *
|
FILE *
|
||||||
fopen(const char *name, const char *mode)
|
fopen(const char *name, const char *mode)
|
||||||
|
@ -88,14 +88,14 @@ fopen(const char *name, const char *mode)
|
||||||
* the file is opened for writing and the open() failed.
|
* the file is opened for writing and the open() failed.
|
||||||
*/
|
*/
|
||||||
if ((rwflags & O_TRUNC)
|
if ((rwflags & O_TRUNC)
|
||||||
|| (((fd = open(name, rwmode)) < 0)
|
|| (((fd = _open(name, rwmode)) < 0)
|
||||||
&& (flags & _IOWRITE)))
|
&& (flags & _IOWRITE)))
|
||||||
fd = creat(name, PMODE);
|
fd = _creat(name, PMODE);
|
||||||
|
|
||||||
if (fd < 0) return (FILE *)NULL;
|
if (fd < 0) return (FILE *)NULL;
|
||||||
|
|
||||||
if (( stream = (FILE *) malloc(sizeof(FILE))) == NULL ) {
|
if (( stream = (FILE *) malloc(sizeof(FILE))) == NULL ) {
|
||||||
close(fd);
|
_close(fd);
|
||||||
return (FILE *)NULL;
|
return (FILE *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
#define O_TRUNC 0x020
|
#define O_TRUNC 0x020
|
||||||
#define O_APPEND 0x040
|
#define O_APPEND 0x040
|
||||||
|
|
||||||
int open(const char *path, int flags);
|
int _open(const char *path, int flags);
|
||||||
int creat(const char *path, int mode);
|
int _creat(const char *path, int mode);
|
||||||
int close(int d);
|
int _close(int d);
|
||||||
|
|
||||||
FILE *
|
FILE *
|
||||||
freopen(const char *name, const char *mode, FILE *stream)
|
freopen(const char *name, const char *mode, FILE *stream)
|
||||||
|
@ -32,7 +32,7 @@ freopen(const char *name, const char *mode, FILE *stream)
|
||||||
int fd, flags = stream->_flags & (_IONBF | _IOFBF | _IOLBF | _IOMYBUF);
|
int fd, flags = stream->_flags & (_IONBF | _IOFBF | _IOLBF | _IOMYBUF);
|
||||||
|
|
||||||
(void) fflush(stream); /* ignore errors */
|
(void) fflush(stream); /* ignore errors */
|
||||||
(void) close(fileno(stream));
|
(void) _close(fileno(stream));
|
||||||
|
|
||||||
switch(*mode++) {
|
switch(*mode++) {
|
||||||
case 'r':
|
case 'r':
|
||||||
|
@ -67,9 +67,9 @@ freopen(const char *name, const char *mode, FILE *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rwflags & O_TRUNC)
|
if ((rwflags & O_TRUNC)
|
||||||
|| (((fd = open(name, rwmode)) < 0)
|
|| (((fd = _open(name, rwmode)) < 0)
|
||||||
&& (flags & _IOWRITE)))
|
&& (flags & _IOWRITE)))
|
||||||
fd = creat(name, PMODE);
|
fd = _creat(name, PMODE);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
for( i = 0; i < FOPEN_MAX; i++) {
|
for( i = 0; i < FOPEN_MAX; i++) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
off_t lseek(int fildes, off_t offset, int whence);
|
off_t _lseek(int fildes, off_t offset, int whence);
|
||||||
|
|
||||||
int
|
int
|
||||||
fseek(FILE *stream, long int offset, int whence)
|
fseek(FILE *stream, long int offset, int whence)
|
||||||
|
@ -29,14 +29,13 @@ fseek(FILE *stream, long int offset, int whence)
|
||||||
&& stream->_buf
|
&& stream->_buf
|
||||||
&& !io_testflag(stream,_IONBF))
|
&& !io_testflag(stream,_IONBF))
|
||||||
adjust = stream->_count;
|
adjust = stream->_count;
|
||||||
pos = lseek(fileno(stream), offset - adjust, whence);
|
|
||||||
stream->_count = 0;
|
stream->_count = 0;
|
||||||
} else if (io_testflag(stream,_IOWRITING)) {
|
} else if (io_testflag(stream,_IOWRITING)) {
|
||||||
fflush(stream);
|
fflush(stream);
|
||||||
pos = lseek(fileno(stream), offset, whence);
|
|
||||||
} else /* neither reading nor writing. The buffer must be empty */
|
} else /* neither reading nor writing. The buffer must be empty */
|
||||||
pos = lseek(fileno(stream), offset, whence);
|
/* EMPTY */ ;
|
||||||
|
|
||||||
|
pos = _lseek(fileno(stream), offset - adjust, whence);
|
||||||
if (io_testflag(stream, _IOREAD) && io_testflag(stream, _IOWRITE))
|
if (io_testflag(stream, _IOREAD) && io_testflag(stream, _IOWRITE))
|
||||||
stream->_flags &= ~(_IOREADING | _IOWRITING);
|
stream->_flags &= ~(_IOREADING | _IOWRITING);
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
off_t lseek(int fildes, off_t offset, int whence);
|
off_t _lseek(int fildes, off_t offset, int whence);
|
||||||
|
|
||||||
long ftell(FILE *stream)
|
long ftell(FILE *stream)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ long ftell(FILE *stream)
|
||||||
adjust = stream->_ptr - stream->_buf;
|
adjust = stream->_ptr - stream->_buf;
|
||||||
else adjust = 0;
|
else adjust = 0;
|
||||||
|
|
||||||
result = lseek(fileno(stream), 0, SEEK_CUR);
|
result = _lseek(fileno(stream), 0, SEEK_CUR);
|
||||||
|
|
||||||
if ( result == -1 )
|
if ( result == -1 )
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* isatty - check if a file descriptor is associated with a terminal
|
* _isatty - check if a file descriptor is associated with a terminal
|
||||||
*/
|
*/
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
|
|
||||||
int gtty(int d, char *buf);
|
int _gtty(int d, char *buf);
|
||||||
|
|
||||||
int isatty(int d)
|
int _isatty(int d)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
/* not a sgttyb struct; it might not be large enough;
|
/* not a sgttyb struct; it might not be large enough;
|
||||||
|
@ -13,5 +13,5 @@ int isatty(int d)
|
||||||
where gtty is an ioctl(..., TCGETA, ...)
|
where gtty is an ioctl(..., TCGETA, ...)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return gtty(d, buf) >= 0;
|
return _gtty(d, buf) >= 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
int _doprnt(const char *format, va_list ap, FILE *stream);
|
int _doprnt(const char *format, va_list ap, FILE *stream);
|
||||||
int _doscan(FILE * stream, const char *format, va_list ap);
|
int _doscan(FILE * stream, const char *format, va_list ap);
|
||||||
char *_i_compute(unsigned long val, int base, char *s, int nrdigits);
|
char *_i_compute(unsigned long val, int base, char *s, int nrdigits);
|
||||||
|
void __cleanup(void);
|
||||||
|
|
||||||
FILE *popen(const char *command, const char *type);
|
FILE *popen(const char *command, const char *type);
|
||||||
FILE *fdopen(int fd, const char *mode);
|
FILE *fdopen(int fd, const char *mode);
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int unlink(const char *path);
|
int _unlink(const char *path);
|
||||||
|
|
||||||
int
|
int
|
||||||
remove(const char *filename) {
|
remove(const char *filename) {
|
||||||
return unlink(filename);
|
return _unlink(filename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int link(const char *name1, const char *name2);
|
int _link(const char *name1, const char *name2);
|
||||||
|
|
||||||
int
|
int
|
||||||
rename(const char *old, const char *new) {
|
rename(const char *old, const char *new) {
|
||||||
if (!link(old, new))
|
if (!_link(old, new))
|
||||||
return remove(old);
|
return remove(old);
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "loc_incl.h"
|
#include "loc_incl.h"
|
||||||
|
|
||||||
extern int (*_fflush)(FILE *stream);
|
extern void (*_clean)(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
setvbuf(register FILE *stream, char *buf, int mode, size_t size)
|
setvbuf(register FILE *stream, char *buf, int mode, size_t size)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
_fflush = fflush;
|
_clean = __cleanup;
|
||||||
if (mode != _IOFBF && mode != _IOLBF && mode != _IONBF)
|
if (mode != _IOFBF && mode != _IOLBF && mode != _IONBF)
|
||||||
return EOF;
|
return EOF;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "loc_incl.h"
|
#include "loc_incl.h"
|
||||||
|
|
||||||
unsigned int getpid(void);
|
unsigned int _getpid(void);
|
||||||
|
|
||||||
FILE *
|
FILE *
|
||||||
tmpfile(void) {
|
tmpfile(void) {
|
||||||
|
@ -17,7 +17,7 @@ tmpfile(void) {
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
name = name_buffer + strlen(name_buffer);
|
name = name_buffer + strlen(name_buffer);
|
||||||
name = _i_compute(getpid(), 10, name, 5);
|
name = _i_compute(_getpid(), 10, name, 5);
|
||||||
*name = '\0';
|
*name = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "loc_incl.h"
|
#include "loc_incl.h"
|
||||||
|
|
||||||
unsigned int getpid(void);
|
unsigned int _getpid(void);
|
||||||
|
|
||||||
char *
|
char *
|
||||||
tmpnam(char *s) {
|
tmpnam(char *s) {
|
||||||
|
@ -17,7 +17,7 @@ tmpnam(char *s) {
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
name = name_buffer + strlen(name_buffer);
|
name = name_buffer + strlen(name_buffer);
|
||||||
name = _i_compute(getpid(), 10, name, 5);
|
name = _i_compute(_getpid(), 10, name, 5);
|
||||||
*name++ = '.';
|
*name++ = '.';
|
||||||
*name++ = '\0';
|
*name++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue