libgo: Try to guess the right type for select bits in mksysinfo.
From-SVN: r171858
This commit is contained in:
parent
15a03a11ce
commit
4ac7fcaac0
2
libgo/configure
vendored
2
libgo/configure
vendored
@ -14228,7 +14228,7 @@ no)
|
||||
;;
|
||||
esac
|
||||
|
||||
for ac_header in sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h
|
||||
for ac_header in sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h
|
||||
do :
|
||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||
|
@ -417,7 +417,7 @@ no)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h)
|
||||
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h)
|
||||
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
|
||||
|
||||
AC_CHECK_FUNCS(srandom random strerror_r strsignal wait4)
|
||||
|
@ -73,6 +73,9 @@ cat > sysinfo.c <<EOF
|
||||
#if defined(HAVE_SYS_UTSNAME_H)
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
EOF
|
||||
|
||||
@ -438,4 +441,12 @@ grep '^type _ip_mreq ' gen-sysinfo.go | \
|
||||
-e 's/_in_addr/[4]byte/g' \
|
||||
>> ${OUT}
|
||||
|
||||
# Try to guess the type to use for fd_set.
|
||||
fd_set=`grep '^type _fd_set ' gen-sysinfo.go || true`
|
||||
fds_bits_type="_C_long"
|
||||
if test "$fd_set" != ""; then
|
||||
fds_bits_type=`echo $fd_set | sed -e 's/.*[]]\([^;]*\); }$/\1/'`
|
||||
fi
|
||||
echo "type fds_bits_type $fds_bits_type" >> ${OUT}
|
||||
|
||||
exit $?
|
||||
|
@ -181,10 +181,10 @@ func Gettimeofday(tv *Timeval) (errno int) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nfdbits = unsafe.Sizeof(_C_long) * 8
|
||||
const nfdbits = unsafe.Sizeof(fds_bits_type) * 8
|
||||
|
||||
type FdSet_t struct {
|
||||
Fds_bits [(FD_SETSIZE + nfdbits - 1) / nfdbits]_C_long
|
||||
Fds_bits [(FD_SETSIZE + nfdbits - 1) / nfdbits]fds_bits_type
|
||||
}
|
||||
|
||||
func FDSet(fd int, set *FdSet_t) {
|
||||
|
Loading…
Reference in New Issue
Block a user