update autoconf for latest compat functions

This commit is contained in:
Brent Cook
2019-01-31 09:45:56 -06:00
parent 495a1b6316
commit a6d7ea9562
10 changed files with 107 additions and 19 deletions

View File

@@ -0,0 +1,9 @@
#include <stdlib.h>
#include <errno.h>
const char *
getprogname(void)
{
return program_invocation_short_name;
}

View File

@@ -0,0 +1,13 @@
#include <stdlib.h>
#include <windows.h>
const char *
getprogname(void)
{
static char progname[MAX_PATH + 1];
DWORD length = GetModuleFileName(NULL, progname, sizeof (progname) - 1);
if (length < 0)
return "?";
return progname;
}

View File

@@ -4,6 +4,7 @@
* BSD socket emulation code for Winsock2
* File IO compatibility shims
* Brent Cook <bcook@openbsd.org>
* Kinichiro Inoguchi <inoguchi@openbsd.org>
*/
#define NO_REDEF_POSIX_FUNCTIONS
@@ -208,6 +209,12 @@ posix_setsockopt(int sockfd, int level, int optname,
return rc == 0 ? 0 : wsa_errno(WSAGetLastError());
}
uid_t getuid(void)
{
/* Windows fstat sets 0 as st_uid */
return 0;
}
#ifdef _MSC_VER
struct timezone;
int gettimeofday(struct timeval * tp, struct timezone * tzp)

19
crypto/compat/syslog_r.c Normal file
View File

@@ -0,0 +1,19 @@
#include <syslog.h>
void
syslog_r(int pri, struct syslog_data *data, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsyslog_r(pri, data, fmt, ap);
va_end(ap);
}
void
vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap)
{
#ifdef HAVE_SYSLOG
vsyslog(pri, fmt, ap);
#endif
}