diff --git a/configure b/configure index 139ff443590..4228461573e 100755 --- a/configure +++ b/configure @@ -4555,11 +4555,21 @@ fi for ac_func in \ _lwp_create \ clone \ + getnetbyaddr \ + getnetbyname \ getpagesize \ + getprotobyname \ + getprotobynumber \ + getservbyport \ + getsockopt \ + inet_network \ memmove \ rfork \ + select \ sendmsg \ + settimeofday \ sigaltstack \ + statfs \ strcasecmp \ strerror \ strncasecmp \ @@ -4572,12 +4582,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4576: checking for $ac_func" >&5 +echo "configure:4586: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4677,17 +4687,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4681: checking for $ac_hdr" >&5 +echo "configure:4691: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4714,12 +4724,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:4718: checking whether stat file-mode macros are broken" >&5 +echo "configure:4728: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4772,12 +4782,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4776: checking for working const" >&5 +echo "configure:4786: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4847,21 +4857,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:4851: checking for inline" >&5 +echo "configure:4861: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -4887,12 +4897,12 @@ EOF esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4891: checking for ANSI C header files" >&5 +echo "configure:4901: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4900,7 +4910,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4917,7 +4927,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4935,7 +4945,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4956,7 +4966,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4967,7 +4977,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -4991,12 +5001,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:4995: checking for size_t" >&5 +echo "configure:5005: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5024,7 +5034,7 @@ EOF fi echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:5028: checking size of long long" >&5 +echo "configure:5038: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5032,7 +5042,7 @@ else ac_cv_sizeof_long_long=0 else cat > conftest.$ac_ext < main() @@ -5043,7 +5053,7 @@ main() exit(0); } EOF -if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -5066,12 +5076,12 @@ EOF if test "$ac_cv_header_linux_joystick_h" = "yes" then echo $ac_n "checking "whether linux/joystick.h uses the Linux 2.2+ API"""... $ac_c" 1>&6 -echo "configure:5070: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5 +echo "configure:5080: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5 if eval "test \"`echo '$''{'wine_cv_linux_joystick_22_api'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5086,7 +5096,7 @@ int main() { /*empty*/ ; return 0; } EOF -if { (eval echo configure:5090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_linux_joystick_22_api=yes else @@ -5113,12 +5123,12 @@ fi if test "$ac_cv_header_sys_vfs_h" = "yes" then echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:5117: checking "whether sys/vfs.h defines statfs"" >&5 +echo "configure:5127: checking "whether sys/vfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5135,7 +5145,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_vfs_has_statfs=yes else @@ -5162,12 +5172,12 @@ fi if test "$ac_cv_header_sys_statfs_h" = "yes" then echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:5166: checking "whether sys/statfs.h defines statfs"" >&5 +echo "configure:5176: checking "whether sys/statfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5182,7 +5192,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_statfs_has_statfs=yes else @@ -5209,12 +5219,12 @@ fi if test "$ac_cv_header_sys_mount_h" = "yes" then echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6 -echo "configure:5213: checking "whether sys/mount.h defines statfs"" >&5 +echo "configure:5223: checking "whether sys/mount.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5229,7 +5239,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_mount_has_statfs=yes else @@ -5255,7 +5265,7 @@ fi echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6 -echo "configure:5259: checking "for statfs.f_bfree"" >&5 +echo "configure:5269: checking "for statfs.f_bfree"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5264,7 +5274,7 @@ else wine_cv_statfs_bfree=no else cat > conftest.$ac_ext < @@ -5291,7 +5301,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bfree=yes else @@ -5315,7 +5325,7 @@ EOF fi echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 -echo "configure:5319: checking "for statfs.f_bavail"" >&5 +echo "configure:5329: checking "for statfs.f_bavail"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5324,7 +5334,7 @@ else wine_cv_statfs_bavail=no else cat > conftest.$ac_ext < @@ -5351,7 +5361,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bavail=yes else @@ -5376,7 +5386,7 @@ fi echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6 -echo "configure:5380: checking "for working sigaltstack"" >&5 +echo "configure:5390: checking "for working sigaltstack"" >&5 if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5385,7 +5395,7 @@ else else cat > conftest.$ac_ext < @@ -5423,7 +5433,7 @@ else } EOF -if { (eval echo configure:5427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_working_sigaltstack="yes" else @@ -5450,12 +5460,12 @@ fi echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6 -echo "configure:5454: checking "for msg_accrights in struct msghdr"" >&5 +echo "configure:5464: checking "for msg_accrights in struct msghdr"" >&5 if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5463,7 +5473,7 @@ int main() { struct msghdr hdr; hdr.msg_accrights=0 ; return 0; } EOF -if { (eval echo configure:5467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_msg_accrights="yes" else @@ -5486,12 +5496,12 @@ fi echo $ac_n "checking "whether we need to define __i386__"""... $ac_c" 1>&6 -echo "configure:5490: checking "whether we need to define __i386__"" >&5 +echo "configure:5500: checking "whether we need to define __i386__"" >&5 if eval "test \"`echo '$''{'ac_cv_cpp_def_i386'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include + +/* Types */ + +#if !defined(HAVE_GETNETBYADDR) && !defined(HAVE_GETNETBYNAME) +struct netent { + char *n_name; + char **n_aliases; + int n_addrtype; + unsigned long n_net; +}; +#endif /* !defined(HAVE_GETNETBYADDR) && !defined(HAVE_GETNETBYNAME) */ + +#if !defined(HAVE_GETPROTOBYNAME) && !defined(HAVE_GETPROTOBYNUMBER) +struct protoent { + char *p_name; + char **p_aliases; + int p_proto; +}; +#endif /* !defined(HAVE_GETPROTOBYNAME) && !defined(HAVE_GETPROTOBYNUMBER) */ + +#ifndef HAVE_STATFS +# ifdef __BEOS__ +# define STATFS_HAS_BFREE +struct statfs { + long f_bsize; /* block_size */ + long f_blocks; /* total_blocks */ + long f_bfree; /* free_blocks */ +}; +# else /* defined(__BEOS__) */ +struct statfs; +# endif /* defined(__BEOS__) */ +#endif /* !defined(HAVE_STATFS) */ + +/* Functions */ + +#if !defined(HAVE_CLONE) && defined(linux) +int clone(int (*fn)(void *arg), void *stack, int flags, void *arg); +#endif /* !defined(HAVE_CLONE) && defined(linux) */ + +#ifndef HAVE_GETNETBYADDR +struct netent *getnetbyaddr(unsigned long net, int type); +#endif /* defined(HAVE_GETNETBYNAME) */ + +#ifndef HAVE_GETNETBYNAME +struct netent *getnetbyname(const char *name); +#endif /* defined(HAVE_GETNETBYNAME) */ + +#ifndef HAVE_GETPROTOBYNAME +struct protoent *getprotobyname(const char *name); +#endif /* !defined(HAVE_GETPROTOBYNAME) */ + +#ifndef HAVE_GETPROTOBYNUMBER +struct protoent *getprotobynumber(int proto); +#endif /* !defined(HAVE_GETPROTOBYNUMBER) */ + +#ifndef HAVE_GETSERVBYPORT +struct servent *getservbyport(int port, const char *proto); +#endif /* !defined(HAVE_GETSERVBYPORT) */ + +#ifndef HAVE_GETSOCKOPT +int getsockopt(int socket, int level, int option_name, void *option_value, size_t *option_len); +#endif /* !defined(HAVE_GETSOCKOPT) */ + +#ifndef HAVE_MEMMOVE +void *memmove(void *dest, const void *src, unsigned int len); +#endif /* !defined(HAVE_MEMMOVE) */ + +#ifndef HAVE_INET_NETWORK +unsigned long inet_network(const char *cp); +#endif /* !defined(HAVE_INET_NETWORK) */ + +#ifndef HAVE_SETTIMEOFDAY +int settimeofday(struct timeval *tp, void *reserved); +#endif /* !defined(HAVE_SETTIMEOFDAY) */ + +#ifndef HAVE_STATFS +int statfs(const char *name, struct statfs *info); +#endif /* !defined(HAVE_STATFS) */ + +#ifndef HAVE_STRNCASECMP +int strncasecmp(const char *str1, const char *str2, size_t n); +#endif /* !defined(HAVE_STRNCASECMP) */ + +#ifndef HAVE_STRERROR +const char *strerror(int err); +#endif /* !defined(HAVE_STRERROR) */ + +#ifndef HAVE_STRCASECMP +int strcasecmp(const char *str1, const char *str2); +#endif /* !defined(HAVE_STRCASECMP) */ + +#ifndef HAVE_USLEEP +int usleep (unsigned int useconds); +#endif /* !defined(HAVE_USLEEP) */ + +#endif /* !defined(__WINE_WINE_PORT_H) */ diff --git a/misc/port.c b/misc/port.c index 934d0f82dab..c03819b28f3 100644 --- a/misc/port.c +++ b/misc/port.c @@ -4,8 +4,14 @@ * Copyright 1996 Alexandre Julliard */ -#include "config.h" +#include "wine/port.h" +#ifdef __BEOS__ +#include +#include +#endif + +#include #include #include #include @@ -20,13 +26,22 @@ #ifdef HAVE_LIBIO_H # include #endif +#ifdef HAVE_SYSCALL_H +# include +#endif +/*********************************************************************** + * usleep + */ #ifndef HAVE_USLEEP -#ifdef __EMX__ -unsigned int usleep (unsigned int useconds) { DosSleep(useconds); } -#else unsigned int usleep (unsigned int useconds) { +#if defined(__EMX__) + DosSleep(useconds); + return 0; +#elif defined(__BEOS__) + return snooze(useconds); +#elif defined(HAVE_SELECT) struct timeval delay; delay.tv_sec = 0; @@ -34,10 +49,16 @@ unsigned int usleep (unsigned int useconds) select( 0, 0, 0, 0, &delay ); return 0; +#else /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */ + errno = ENOSYS; + return -1; +#endif /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */ } -#endif #endif /* HAVE_USLEEP */ +/*********************************************************************** + * memmove + */ #ifndef HAVE_MEMMOVE void *memmove( void *dest, const void *src, unsigned int len ) { @@ -63,6 +84,9 @@ void *memmove( void *dest, const void *src, unsigned int len ) } #endif /* HAVE_MEMMOVE */ +/*********************************************************************** + * strerror + */ #ifndef HAVE_STRERROR const char *strerror( int err ) { @@ -71,12 +95,10 @@ const char *strerror( int err ) } #endif /* HAVE_STRERROR */ +/*********************************************************************** + * clone + */ #if !defined(HAVE_CLONE) && defined(__linux__) -#include -#include -#ifdef HAVE_SYSCALL_H -# include -#endif int clone( int (*fn)(void *), void *stack, int flags, void *arg ) { #ifdef __i386__ @@ -106,7 +128,9 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg ) } #endif /* !HAVE_CLONE && __linux__ */ - +/*********************************************************************** + * strcasecmp + */ #ifndef HAVE_STRCASECMP int strcasecmp( const char *str1, const char *str2 ) { @@ -115,6 +139,9 @@ int strcasecmp( const char *str1, const char *str2 ) } #endif /* HAVE_STRCASECMP */ +/*********************************************************************** + * strncasecmp + */ #ifndef HAVE_STRNCASECMP int strncasecmp( const char *str1, const char *str2, size_t n ) { @@ -126,13 +153,16 @@ int strncasecmp( const char *str1, const char *str2, size_t n ) } #endif /* HAVE_STRNCASECMP */ -/** - * It looks like the openpty that comes with glibc in RedHat 5.0 - * is buggy (second call returns what looks like a dup of 0 and 1 - * instead of a new pty), this is a generic replacement. +/*********************************************************************** + * wine_openpty + * NOTE + * It looks like the openpty that comes with glibc in RedHat 5.0 + * is buggy (second call returns what looks like a dup of 0 and 1 + * instead of a new pty), this is a generic replacement. + * + * FIXME + * We should have a autoconf check for this. */ -/** We will have an autoconf check for this soon... */ - int wine_openpty(int *master, int *slave, char *name, struct termios *term, struct winsize *winsize) { @@ -170,3 +200,131 @@ int wine_openpty(int *master, int *slave, char *name, return -1; } +/*********************************************************************** + * getnetbyaddr + */ +#ifndef HAVE_GETNETBYADDR +struct netent *getnetbyaddr(unsigned long net, int type) +{ + errno = ENOSYS; + return NULL; +} +#endif /* defined(HAVE_GETNETBYNAME) */ + +/*********************************************************************** + * getnetbyname + */ +#ifndef HAVE_GETNETBYNAME +struct netent *getnetbyname(const char *name) +{ + errno = ENOSYS; + return NULL; +} +#endif /* defined(HAVE_GETNETBYNAME) */ + +/*********************************************************************** + * getprotobyname + */ +#ifndef HAVE_GETPROTOBYNAME +struct protoent *getprotobyname(const char *name) +{ + errno = ENOSYS; + return NULL; +} +#endif /* !defined(HAVE_GETPROTOBYNAME) */ + +/*********************************************************************** + * getprotobynumber + */ +#ifndef HAVE_GETPROTOBYNUMBER +struct protoent *getprotobynumber(int proto) +{ + errno = ENOSYS; + return NULL; +} +#endif /* !defined(HAVE_GETPROTOBYNUMBER) */ + +/*********************************************************************** + * getservbyport + */ +#ifndef HAVE_GETSERVBYPORT +struct servent *getservbyport(int port, const char *proto) +{ + errno = ENOSYS; + return NULL; +} +#endif /* !defined(HAVE_GETSERVBYPORT) */ + +/*********************************************************************** + * getsockopt + */ +#ifndef HAVE_GETSOCKOPT +int getsockopt(int socket, int level, int option_name, + void *option_value, size_t *option_len) +{ + errno = ENOSYS; + return -1; +} +#endif /* !defined(HAVE_GETSOCKOPT) */ + +/*********************************************************************** + * inet_network + */ +#ifndef HAVE_INET_NETWORK +unsigned long inet_network(const char *cp) +{ + errno = ENOSYS; + return 0; +} +#endif /* defined(HAVE_INET_NETWORK) */ + +/*********************************************************************** + * settimeofday + */ +#ifndef HAVE_SETTIMEOFDAY +int settimeofday(struct timeval *tp, void *reserved) +{ + tp->tv_sec = 0; + tp->tv_usec = 0; + + errno = ENOSYS; + return -1; +} +#endif /* HAVE_SETTIMEOFDAY */ + +/*********************************************************************** + * statfs + */ +#ifndef HAVE_STATFS +int statfs(const char *name, struct statfs *info) +{ +#ifdef __BEOS__ + dev_t mydev; + fs_info fsinfo; + + if(!info) { + errno = ENOSYS; + return -1; + } + + if ((mydev = dev_for_path(name)) < 0) { + errno = ENOSYS; + return -1; + } + + if (fs_stat_dev(mydev,&fsinfo) < 0) { + errno = ENOSYS; + return -1; + } + + info->f_bsize = fsinfo.block_size; + info->f_blocks = fsinfo.total_blocks; + info->f_bfree = fsinfo.free_blocks; + + return 0; +#else /* defined(__BEOS__) */ + errno = ENOSYS; + return -1; +#endif /* defined(__BEOS__) */ +} +#endif /* !defined(HAVE_STATFS) */ diff --git a/misc/winsock.c b/misc/winsock.c index 8d7d88118b8..b2349067f0f 100644 --- a/misc/winsock.c +++ b/misc/winsock.c @@ -77,6 +77,7 @@ #include "task.h" #include "message.h" #include "miscemu.h" +#include "wine/port.h" #include "services.h" #include "server.h" #include "debugtools.h" diff --git a/misc/winsock_async.c b/misc/winsock_async.c index 17852ae354d..df88bd79749 100644 --- a/misc/winsock_async.c +++ b/misc/winsock_async.c @@ -83,6 +83,7 @@ #include "task.h" #include "message.h" #include "miscemu.h" +#include "wine/port.h" #include "debugtools.h" DEFAULT_DEBUG_CHANNEL(winsock) diff --git a/scheduler/sysdeps.c b/scheduler/sysdeps.c index c9ea1b0e9a4..ab3f6d97a52 100644 --- a/scheduler/sysdeps.c +++ b/scheduler/sysdeps.c @@ -25,6 +25,7 @@ static int *ph_errno = &h_errno; #ifdef HAVE_UCONTEXT_H # include #endif +#include "wine/port.h" #include "thread.h" #include "server.h" #include "winbase.h" @@ -33,14 +34,10 @@ static int *ph_errno = &h_errno; DEFAULT_DEBUG_CHANNEL(thread) -#ifdef linux -#define HAVE_CLONE_SYSCALL -#endif - /* Xlib critical section (FIXME: does not belong here) */ CRITICAL_SECTION X11DRV_CritSection = { 0, }; -#ifdef HAVE_CLONE_SYSCALL +#ifdef linux # ifdef HAVE_SCHED_H # include # endif @@ -50,10 +47,8 @@ CRITICAL_SECTION X11DRV_CritSection = { 0, }; # define CLONE_FILES 0x00000400 # define CLONE_SIGHAND 0x00000800 # define CLONE_PID 0x00001000 -/* If we didn't get the flags, we probably didn't get the prototype either */ -extern int clone( int (*fn)(void *arg), void *stack, int flags, void *arg ); # endif /* CLONE_VM */ -#endif /* HAVE_CLONE_SYSCALL */ +#endif /* linux */ static int init_done; @@ -155,7 +150,7 @@ int SYSDEPS_SpawnThread( TEB *teb ) { #ifndef NO_REENTRANT_LIBC -#ifdef HAVE_CLONE_SYSCALL +#ifdef linux if (clone( (int (*)(void *))SYSDEPS_StartThread, teb->stack_top, CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, teb ) < 0) return -1;