Merge compat.h and missing.h into missing.h

This commit is contained in:
Todd C. Miller
2010-08-16 14:05:44 -04:00
parent 6ce5c4cd97
commit f454727bb8
52 changed files with 392 additions and 103 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 1998-2005, 2008, 2010
* Copyright (c) 1996, 1998-2005, 2008, 2009-2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -19,11 +19,11 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
#ifndef _SUDO_COMPAT_H
#define _SUDO_COMPAT_H
#ifndef _SUDO_MISSING_H
#define _SUDO_MISSING_H
/*
* Macros that may be missing on some Operating Systems
* Macros and functions that may be missing on some operating systems.
*/
/* Define away __attribute__ for non-gcc or old gcc */
@@ -261,4 +261,64 @@ void setprogname(const char *);
# endif
#endif /* HAVE_SETEUID */
#endif /* _SUDO_COMPAT_H */
#include <stdio.h>
#include <stdarg.h>
/* Functions "missing" from libc. */
struct timeval;
struct timespec;
#ifndef HAVE_CLOSEFROM
void closefrom(int);
#endif
#ifndef HAVE_GETCWD
char *getcwd(char *, size_t size);
#endif
#ifndef HAVE_GETLINE
ssize_t getline(char **, size_t *, FILE *);
#endif
#ifndef HAVE_UTIMES
int utimes(const char *, const struct timeval *);
#endif
#ifdef HAVE_FUTIME
int futimes(int, const struct timeval *);
#endif
#ifndef HAVE_SNPRINTF
int snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
#endif
#ifndef HAVE_VSNPRINTF
int vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
#endif
#ifndef HAVE_ASPRINTF
int asprintf(char **, const char *, ...) __printflike(2, 3);
#endif
#ifndef HAVE_VASPRINTF
int vasprintf(char **, const char *, va_list) __printflike(2, 0);
#endif
#ifndef HAVE_STRLCAT
size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_MEMRCHR
void *memrchr(const void *, int, size_t);
#endif
#ifndef HAVE_MKSTEMPS
int mkstemps(char *, int);
#endif
#ifndef HAVE_NANOSLEEP
int nanosleep(const struct timespec *, struct timespec *);
#endif
#ifndef HAVE_SETENV
int setenv(const char *, const char *, int);
#endif
#ifndef HAVE_UNSETENV
int unsetenv(const char *);
#endif
#ifndef HAVE_STRSIGNAL
char *strsignal(int);
#endif
#endif /* _SUDO_MISSING_H */