curlbuild.h:138:36: error: ‘socklen_t’ does not name a type

Linux下libcurl.so调用错误:解决办法与socklen_t引用
什么问题这个 Applying ./patches/010-fix-mod_webdav.patch using plaintext: patching file src/mod_webdav.c Applying ./patches/020-meson-mod_webdav_min.patch using plaintext: patching file src/meson.build Applying ./patches/030-fix-mips-gcc-not-support-__has_include-compile-error using plaintext: patching file src/mod_magnet.c Hunk #1 succeeded at 204 with fuzz 2. touch /data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/.prepared_ca9f6165c1130812efd2b0b7b8318bed (cd /data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/./; if [ -x ./configure ]; then /usr/bin/find /data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/ -name config.guess | xargs -r chmod u+w; /usr/bin/find /data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/ -name config.guess | xargs -r -n1 cp /data/red-round3/red-round3/Iplatform/openwrt/scripts/config.guess; /usr/bin/find /data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/ -name config.sub | xargs -r chmod u+w; /usr/bin/find /data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/ -name config.sub | xargs -r -n1 cp /data/red-round3/red-round3/Iplatform/openwrt/scripts/config.sub; AR=arm-buildroot-linux-gnueabi-ar AS="arm-buildroot-linux-gnueabi-gcc -c " LD=arm-buildroot-linux-gnueabi-ld NM=arm-buildroot-linux-gnueabi-nm CC="arm-buildroot-linux-gnueabi-gcc" GCC="arm-buildroot-linux-gnueabi-gcc" CXX="arm-buildroot-linux-gnueabi-g++" RANLIB=arm-buildroot-linux-gnueabi-ranlib STRIP=arm-buildroot-linux-gnueabi-strip OBJCOPY=arm-buildroot-linux-gnueabi-objcopy OBJDUMP=arm-buildroot-linux-gnueabi-objdump SIZE=arm-buildroot-linux-gnueabi-size CFLAGS=" " CXXFLAGS=" " CPPFLAGS="-I/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/usr/include -I/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/include -I/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/usr-be220v1/include -I/data/red-round3/red-round3/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/usr/include " LDFLAGS="-L/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/usr/lib -L/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/lib -Wl,-rpath-link,/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/usr/lib -L/data/red-round3/red-round3/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/usr/lib -L/data/red-round3/red-round3/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/lib " ./configure --target=arm-openwrt-linux-uclibc --host=arm-openwrt-linux-uclibc --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls --with-webdav-props --with-webdav-locks --with-openssl --with-openssl-libs=/usr/lib --with-lua ; fi; ) configure: WARNING: unrecognized options: --disable-nls configure: loading site script /data/red-round3/red-round3/Iplatform/openwrt/include/site/arm-openwrt-linux-uclibc checking build system type... x86_64-pc-linux-gnu checking host system type... arm-openwrt-linux-uclibc checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-openwrt-linux-uclibc-strip... arm-buildroot-linux-gnueabi-strip checking for a race-free mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether UID '1000' is supported by ustar format... yes checking whether GID '1000' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking for arm-openwrt-linux-uclibc-gcc... arm-buildroot-linux-gnueabi-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether arm-buildroot-linux-gnueabi-gcc accepts -g... yes checking for arm-buildroot-linux-gnueabi-gcc option to enable C11 features... none needed checking whether arm-buildroot-linux-gnueabi-gcc understands -c and -o together... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of arm-buildroot-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-buildroot-linux-gnueabi-gcc -E checking for x86_64-pc-linux-gnu-gcc... no checking for gcc... gcc checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... -std=gnu11 checking whether gcc -std=gnu11 understands -c and -o together... yes checking dependency style of gcc -std=gnu11... gcc3 checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking how to run the C preprocessor... gcc -std=gnu11 -E checking for a sed that does not truncate output... /data/red-round3/red-round3/Iplatform/openwrt/staging_dir/host/bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking how to print strings... printf checking for ld used by arm-buildroot-linux-gnueabi-gcc... arm-buildroot-linux-gnueabi-ld checking if the linker (arm-buildroot-linux-gnueabi-ld) is GNU ld... yes checking how to run the C preprocessor... arm-buildroot-linux-gnueabi-gcc -E checking whether make sets $(MAKE)... (cached) yes checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for wchar.h... yes checking for minix/config.h... no checking whether it is safe to define __EXTENSIONS__... yes checking whether _XOPEN_SOURCE should be defined... no checking for arm-openwrt-linux-uclibc-ar... arm-buildroot-linux-gnueabi-ar checking the archiver (arm-buildroot-linux-gnueabi-ar) interface... ar checking for inline... inline checking for C/C++ restrict keyword... __restrict__ checking for BSD- or MS-compatible name lister (nm)... arm-buildroot-linux-gnueabi-nm checking the name lister (arm-buildroot-linux-gnueabi-nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to arm-openwrt-linux-uclibc format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for arm-buildroot-linux-gnueabi-ld option to reload object files... -r checking for arm-openwrt-linux-uclibc-file... no checking for file... file configure: WARNING: using cross tools not prefixed with host triplet checking for arm-openwrt-linux-uclibc-objdump... arm-buildroot-linux-gnueabi-objdump checking how to recognize dependent libraries... pass_all checking for arm-openwrt-linux-uclibc-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for arm-openwrt-linux-uclibc-ar... (cached) arm-buildroot-linux-gnueabi-ar checking for archiver @FILE support... @ checking for arm-openwrt-linux-uclibc-strip... (cached) arm-buildroot-linux-gnueabi-strip checking for arm-openwrt-linux-uclibc-ranlib... arm-buildroot-linux-gnueabi-ranlib checking command to parse arm-buildroot-linux-gnueabi-nm output from arm-buildroot-linux-gnueabi-gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for arm-openwrt-linux-uclibc-mt... no checking for mt... mt checking if mt is a manifest tool... no checking for dlfcn.h... yes checking for objdir... .libs checking if arm-buildroot-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-buildroot-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC checking if arm-buildroot-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes checking if arm-buildroot-linux-gnueabi-gcc static flag -static works... yes checking if arm-buildroot-linux-gnueabi-gcc supports -c -o file.o... yes checking if arm-buildroot-linux-gnueabi-gcc supports -c -o file.o... (cached) yes checking whether the arm-buildroot-linux-gnueabi-gcc linker (arm-buildroot-linux-gnueabi-ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for shl_load... no checking for shl_load in -ldld... no checking for dlopen... no checking for dlopen in -ldl... yes checking whether a program can dlopen itself... cross checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking for sys/wait.h that is POSIX.1 compatible... yes checking for getopt.h... yes checking for inttypes.h... (cached) yes checking for poll.h... yes checking for pwd.h... yes checking for stdlib.h... (cached) yes checking for stdint.h... (cached) yes checking for strings.h... (cached) yes checking for sys/inotify.h... yes checking for sys/loadavg.h... no checking for sys/poll.h... yes checking for sys/prctl.h... yes checking for sys/procctl.h... no checking for sys/sendfile.h... yes checking for sys/time.h... yes checking for sys/uio.h... yes checking for sys/un.h... yes checking for syslog.h... yes checking for uuid/uuid.h... yes checking for an ANSI C-conforming const... yes checking for inline... (cached) inline checking for off_t... yes checking for pid_t... yes checking for size_t... yes checking for struct tm.tm_gmtoff... yes checking for socklen_t... yes checking for library containing socket... none required checking for library containing gethostbyname... none required checking for library containing clock_gettime... none required checking for library containing elftc_copyfile... no checking for library containing dlopen... -ldl checking for dlfcn.h... (cached) yes checking pkg-config is at least version 0.9.0... yes configure: ---------------------------------------- checking for libev support... no configure: ---------------------------------------- checking for MySQL support... no configure: ---------------------------------------- checking for PgSQL support... no configure: ---------------------------------------- checking for LibDBI support... no configure: ---------------------------------------- checking for LibSASL support... no configure: ---------------------------------------- checking for LDAP support... no configure: ---------------------------------------- checking for PAM support... configure: ---------------------------------------- checking for extended attributes support... no configure: ---------------------------------------- checking for valgrind... no configure: ---------------------------------------- checking for libunwind... no configure: ---------------------------------------- checking for kerberos5... no checking custom include directory for kerberos5... no checking custom lib directory for kerberos5... no configure: ---------------------------------------- checking for OpenSSL... yes checking custom include directory for openssl... no checking custom lib directory for openssl... /usr/lib checking for openssl/ssl.h... yes checking for RAND_bytes in -lcrypto... yes checking for SSL_new in -lssl... yes configure: ---------------------------------------- checking for wolfSSL... no configure: ---------------------------------------- checking for mbedTLS... no configure: ---------------------------------------- checking for Nettle... no configure: ---------------------------------------- checking for GnuTLS... no configure: ---------------------------------------- checking for NSS... no configure: ---------------------------------------- checking for perl regular expressions support... no configure: ---------------------------------------- checking for perl regular expressions support... yes checking for PCRE2... no checking for pcre2-config... no configure: error: pcre2-config not found, install the pcre2-devel package or build with --without-pcre2 Makefile:254: recipe for target '/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/.configured_nnnnnnnnnnnynnnnynnnnnn' failed make[3]: *** [/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/lighttpd-1.4.71/.configured_nnnnnnnnnnnynnnnynnnnnn] Error 1 make[3]: Leaving directory '/data/red-round3/red-round3/Iplatform/packages/opensource/lighttpd' package/Makefile:133: recipe for target 'package/feeds/iplatform/lighttpd/compile' failed make[2]: *** [package/feeds/iplatform/lighttpd/compile] Error 2 make[2]: Leaving directory '/data/red-round3/red-round3/Iplatform/openwrt' /data/red-round3/red-round3/Iplatform/openwrt/include/toplevel.mk:184: recipe for target 'package/lighttpd/compile' failed make[1]: *** [package/lighttpd/compile] Error 2 make[1]: Leaving directory '/data/red-round3/red-round3/Iplatform/openwrt' Makefile:234: recipe for target 'iplatform_package/lighttpd/compile' failed make: *** [iplatform_package/lighttpd/compile] Error 2
最新发布
09-27
fatal: [192.168.5.158]: FAILED! => {"changed": true, "cmd": "cd /usr/src/php-5.3.28/ && ./configure --prefix=/usr/local/php5 --with-gd --with-zlib --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php5 --enable-mbstring --enable-fpm --with-jpeg-dir=/usr/lib && make && make install", "delta": "0:00:07.761196", "end": "2025-06-26 15:07:53.247233", "msg": "non-zero return code", "rc": 1, "start": "2025-06-26 15:07:45.486037", "stderr": "configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4 (found: none).\nconfigure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.\nconfigure: error: Cannot find MySQL header files under /usr/local/mysql.\nNote that the MySQL client library is not bundled anymore!", "stderr_lines": ["configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4 (found: none).", "configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.", "configure: error: Cannot find MySQL header files under /usr/local/mysql.", "Note that the MySQL client library is not bundled anymore!"], "stdout": "creating cache ./config.cache\nchecking for Cygwin environment... no\nchecking for mingw32 environment... no\nchecking for egrep... grep -E\nchecking for a sed that does not truncate output... /usr/bin/sed\nchecking host system type... x86_64-unknown-linux-gnu\nchecking target system type... x86_64-unknown-linux-gnu\nchecking for gcc... gcc\nchecking whether the C compiler (gcc ) works... yes\nchecking whether the C compiler (gcc ) is a cross-compiler... no\nchecking whether we are using GNU C... yes\nchecking whether gcc accepts -g... yes\nchecking how to run the C preprocessor... gcc -E\nchecking for icc... no\nchecking for suncc... no\nchecking whether gcc and cc understand -c and -o together... yes\nchecking how to run the C preprocessor... gcc -E\nchecking for AIX... no\nchecking whether ln -s works... yes\nchecking for system library directory... lib\nchecking whether to enable runpaths... yes\nchecking if compiler supports -R... no\nchecking if compiler supports -Wl,-rpath,... yes\nchecking for gawk... gawk\nchecking for bison... no\nchecking for byacc... no\nchecking for bison version... invalid\nchecking for re2c... no\nchecking whether to enable computed goto gcc extension with re2c... no\nchecking whether to force non-PIC code in shared modules... no\nchecking whether /dev/urandom exists... yes\nchecking for pthreads_cflags... -pthread\nchecking for pthreads_lib... \n\n\u001b[1mConfiguring SAPI modules\u001b[m\nchecking for AOLserver support... no\nchecking for Apache 1.x module support via DSO through APXS... no\nchecking for Apache 1.x module support... no\nchecking whether to enable Apache charset compatibility option... no\nchecking for Apache 2.0 filter-module support via DSO through APXS... no\nchecking for Apache 2.0 handler-module support via DSO through APXS... no\nchecking for Apache 1.x (hooks) module support via DSO through APXS... no\nchecking for Apache 1.x (hooks) module support... no\nchecking whether to enable Apache charset compatibility option... no\nchecking for Caudium support... no\nchecking for CLI build... yes\nchecking for Continuity support... no\nchecking for embedded SAPI library support... no\nchecking for FPM build... yes\nchecking for setenv... yes\nchecking for clearenv... yes\nchecking for setproctitle... no\nchecking for library containing socket... none required\nchecking for library containing inet_addr... none required\nchecking for errno.h... yes\nchecking for fcntl.h... yes\nchecking for stdio.h... yes\nchecking for stdlib.h... yes\nchecking for unistd.h... yes\nchecking for sys/uio.h... yes\nchecking for sys/select.h... yes\nchecking for sys/socket.h... yes\nchecking for sys/time.h... yes\nchecking for arpa/inet.h... yes\nchecking for netinet/in.h... yes\nchecking for sysexits.h... yes\nchecking for prctl... yes\nchecking for clock_gettime... yes\nchecking for ptrace... yes\nchecking whether ptrace works... yes\nchecking for proc mem file... mem\nchecking if gcc supports __sync_bool_compare_and_swap... yes\nchecking for TCP_INFO... yes\nchecking for sysconf... yes\nchecking for times... yes\nchecking for kqueue... no\nchecking for port framework... no\nchecking for /dev/poll... no\nchecking for epoll... yes\nchecking for poll... yes\nchecking for select... yes\nchecking for Zeus ISAPI support... no\nchecking for LiteSpeed support... no\nchecking for Milter support... no\nchecking for NSAPI support... no\nchecking for PHTTPD support... no\nchecking for Pi3Web support... no\nchecking whether Roxen module is build using ZTS... no\nchecking for Roxen/Pike support... \nchecking for thttpd... no\nchecking for TUX... no\nchecking for webjames... no\nchecking for chosen SAPI module... fpm\n\n\u001b[1mRunning system checks\u001b[m\nchecking for sendmail... no\nchecking whether system uses EBCDIC... no\nchecking whether byte ordering is bigendian... no\nchecking whether writing to stdout works... This is the test message -- yes\nchecking for socket... yes\nchecking for socketpair... yes\nchecking for htonl... yes\nchecking for gethostname... yes\nchecking for gethostbyaddr... yes\nchecking for yp_get_default_domain... no\nchecking for __yp_get_default_domain... no\nchecking for yp_get_default_domain in -lnsl... no\nchecking for __yp_get_default_domain in -lnsl... no\nchecking for dlopen... no\nchecking for __dlopen... no\nchecking for dlopen in -ldl... yes\nchecking for sin in -lm... yes\nchecking for inet_aton... yes\nchecking for ANSI C header files... yes\nchecking for dirent.h that defines DIR... yes\nchecking for opendir in -ldir... no\nchecking for inttypes.h... yes\nchecking for stdint.h... yes\nchecking for dirent.h... yes\nchecking for ApplicationServices/ApplicationServices.h... no\nchecking for sys/param.h... yes\nchecking for sys/types.h... yes\nchecking for sys/time.h... (cached) yes\nchecking for netinet/in.h... (cached) yes\nchecking for alloca.h... yes\nchecking for arpa/inet.h... (cached) yes\nchecking for arpa/nameser.h... yes\nchecking for assert.h... yes\nchecking for crypt.h... yes\nchecking for dns.h... no\nchecking for fcntl.h... (cached) yes\nchecking for grp.h... yes\nchecking for ieeefp.h... no\nchecking for langinfo.h... yes\nchecking for limits.h... yes\nchecking for locale.h... yes\nchecking for monetary.h... yes\nchecking for netdb.h... yes\nchecking for pwd.h... yes\nchecking for resolv.h... yes\nchecking for signal.h... yes\nchecking for stdarg.h... yes\nchecking for stdlib.h... (cached) yes\nchecking for string.h... yes\nchecking for syslog.h... yes\nchecking for sysexits.h... (cached) yes\nchecking for sys/ioctl.h... yes\nchecking for sys/file.h... yes\nchecking for sys/mman.h... yes\nchecking for sys/mount.h... yes\nchecking for sys/poll.h... yes\nchecking for sys/resource.h... yes\nchecking for sys/select.h... (cached) yes\nchecking for sys/socket.h... (cached) yes\nchecking for sys/stat.h... yes\nchecking for sys/statfs.h... yes\nchecking for sys/statvfs.h... yes\nchecking for sys/vfs.h... yes\nchecking for sys/sysexits.h... no\nchecking for sys/varargs.h... no\nchecking for sys/wait.h... yes\nchecking for sys/loadavg.h... no\nchecking for termios.h... yes\nchecking for unistd.h... (cached) yes\nchecking for unix.h... no\nchecking for utime.h... yes\nchecking for sys/utsname.h... yes\nchecking for sys/ipc.h... yes\nchecking for dlfcn.h... yes\nchecking for assert.h... (cached) yes\nchecking for fopencookie... yes\nchecking for broken getcwd... no\nchecking for broken libc stdio... yes\nchecking whether struct tm is in sys/time.h or time.h... time.h\nchecking for tm_zone in struct tm... yes\nchecking for missing declarations of reentrant functions... done\nchecking for fclose declaration... ok\nchecking for tm_gmtoff in struct tm... yes\nchecking for struct flock... yes\nchecking for socklen_t... yes\nchecking size of size_t... 8\nchecking size of long long... 8\nchecking size of long long int... 8\nchecking size of long... 8\nchecking size of int... 4\nchecking size of intmax_t... 8\nchecking size of ssize_t... 8\nchecking size of ptrdiff_t... 8\nchecking for st_blksize in struct stat... yes\nchecking for st_blocks in struct stat... yes\nchecking for st_rdev in struct stat... yes\nchecking for size_t... yes\nchecking for uid_t in sys/types.h... yes\nchecking for struct sockaddr_storage... yes\nchecking for field sa_len in struct sockaddr... no\nchecking for IPv6 support... yes\nchecking for vprintf... yes\nchecking for alphasort... yes\nchecking for asctime_r... yes\nchecking for chroot... yes\nchecking for ctime_r... yes\nchecking for cuserid... yes\nchecking for crypt... no\nchecking for flock... yes\nchecking for ftok... yes\nchecking for funopen... no\nchecking for gai_strerror... yes\nchecking for gcvt... yes\nchecking for getloadavg... yes\nchecking for getlogin... yes\nchecking for getprotobyname... yes\nchecking for getprotobynumber... yes\nchecking for getservbyname... yes\nchecking for getservbyport... yes\nchecking for gethostname... (cached) yes\nchecking for getrusage... yes\nchecking for gettimeofday... yes\nchecking for gmtime_r... yes\nchecking for getpwnam_r... yes\nchecking for getgrnam_r... yes\nchecking for getpwuid_r... yes\nchecking for grantpt... yes\nchecking for inet_ntoa... yes\nchecking for inet_ntop... yes\nchecking for inet_pton... yes\nchecking for isascii... yes\nchecking for link... yes\nchecking for localtime_r... yes\nchecking for lockf... yes\nchecking for lchown... yes\nchecking for lrand48... yes\nchecking for memcpy... yes\nchecking for memmove... yes\nchecking for mkstemp... yes\nchecking for mmap... yes\nchecking for nl_langinfo... yes\nchecking for perror... yes\nchecking for poll... yes\nchecking for ptsname... yes\nchecking for putenv... yes\nchecking for realpath... yes\nchecking for random... yes\nchecking for rand_r... yes\nchecking for scandir... yes\nchecking for setitimer... yes\nchecking for setlocale... yes\nchecking for localeconv... yes\nchecking for setenv... (cached) yes\nchecking for setpgid... yes\nchecking for setsockopt... yes\nchecking for setvbuf... yes\nchecking for shutdown... yes\nchecking for sin... yes\nchecking for snprintf... yes\nchecking for srand48... yes\nchecking for srandom... yes\nchecking for statfs... yes\nchecking for statvfs... yes\nchecking for std_syslog... no\nchecking for strcasecmp... yes\nchecking for strcoll... yes\nchecking for strdup... yes\nchecking for strerror... yes\nchecking for strftime... yes\nchecking for strnlen... yes\nchecking for strptime... yes\nchecking for strstr... yes\nchecking for strtok_r... yes\nchecking for symlink... yes\nchecking for tempnam... yes\nchecking for tzset... yes\nchecking for unlockpt... yes\nchecking for unsetenv... yes\nchecking for usleep... yes\nchecking for utime... yes\nchecking for vsnprintf... yes\nchecking for vasprintf... yes\nchecking for asprintf... yes\nchecking for nanosleep... yes\nchecking for nanosleep in -lrt... yes\nchecking for getaddrinfo... yes\nchecking for __sync_fetch_and_add... yes\nchecking for strlcat... no\nchecking for strlcpy... no\nchecking for getopt... yes\nchecking whether utime accepts a null argument... yes\nchecking for working alloca.h... (cached) yes\nchecking for alloca... yes\nchecking for declared timezone... yes\nchecking for type of reentrant time-related functions... POSIX\nchecking for readdir_r... yes\nchecking for type of readdir_r... POSIX\nchecking for in_addr_t... yes\nchecking for crypt_r... no\n\n\u001b[1mGeneral settings\u001b[m\nchecking whether to include gcov symbols... no\nchecking whether to include debugging symbols... no\nchecking layout of installed files... PHP\nchecking path to configuration file... /usr/local/php5\nchecking where to scan for configuration files... \nchecking whether to enable safe mode by default... no\nchecking for safe mode exec dir... /usr/local/php/bin\nchecking whether to enable PHP's own SIGCHLD handler... no\nchecking whether to enable magic quotes by default... no\nchecking whether to explicitly link against libgcc... no\nchecking whether to enable short tags by default... yes\nchecking whether to enable dmalloc... no\nchecking whether to enable IPv6 support... yes\nchecking how big to make fd sets... using system default\n\n\u001b[1mConfiguring extensions\u001b[m\nchecking size of long... (cached) 8\nchecking size of int... (cached) 4\nchecking for int32_t... yes\nchecking for uint32_t... yes\nchecking for sys/types.h... (cached) yes\nchecking for inttypes.h... (cached) yes\nchecking for stdint.h... (cached) yes\nchecking for string.h... (cached) yes\nchecking for stdlib.h... (cached) yes\nchecking for strtoll... yes\nchecking for atoll... yes\nchecking for strftime... (cached) yes\nchecking which regex library to use... php\nchecking whether to enable LIBXML support... yes\nchecking libxml2 install dir... no\nchecking for xml2-config path... /usr/bin/xml2-config\nchecking whether libxml build works... yes\nchecking for OpenSSL support... no\nchecking for Kerberos support... no\nchecking for PCRE library to use... bundled\nchecking whether to enable the SQLite3 extension... yes\nchecking bundled sqlite3 library... yes\nchecking for ZLIB support... yes\nchecking if the location of ZLIB install directory is defined... no\nchecking for gzgets in -lz... yes\nchecking whether to enable bc style precision math functions... no\nchecking for BZip2 support... no\nchecking whether to enable calendar conversion support... no\nchecking whether to enable ctype functions... yes\nchecking for cURL support... no\nchecking if we should use cURL for url streams... no\nchecking for QDBM support... no\nchecking for GDBM support... no\nchecking for NDBM support... no\nchecking for Berkeley DB4 support... no\nchecking for Berkeley DB3 support... no\nchecking for Berkeley DB2 support... no\nchecking for DB1 support... no\nchecking for DBM support... no\nchecking for CDB support... no\nchecking for INI File support... no\nchecking for FlatFile support... no\nchecking whether to enable DBA interface... no\nchecking whether to enable DOM support... yes\nchecking for xml2-config path... (cached) /usr/bin/xml2-config\nchecking whether libxml build works... (cached) yes\nchecking for ENCHANT support... no\nchecking whether to enable EXIF (metadata from images) support... no\nchecking for fileinfo support... yes\nchecking for utimes... yes\nchecking for strndup... yes\nchecking whether to enable input filter support... yes\nchecking pcre install prefix... no\nchecking whether to enable FTP support... no\nchecking OpenSSL dir for FTP... no\nchecking for GD support... yes\nchecking for the location of libjpeg... /usr/lib\nchecking for the location of libpng... no\nchecking for the location of libXpm... no\nchecking for FreeType 2... no\nchecking for T1lib support... no\nchecking whether to enable truetype string function in GD... no\nchecking whether to enable JIS-mapped Japanese font support in GD... no\nchecking for fabsf... yes\nchecking for floorf... yes\nchecking for jpeg_read_header in -ljpeg... yes\nchecking for png_write_image in -lpng... yes\nIf configure fails try --with-xpm-dir=<DIR>\nIf configure fails try --with-freetype-dir=<DIR>\nchecking for GNU gettext support... no\nchecking for GNU MP support... no\nchecking for mhash support... no\nchecking whether to enable hash support... yes\nchecking whether byte ordering is bigendian... (cached) no\nchecking size of short... 2\nchecking size of int... (cached) 4\nchecking size of long... (cached) 8\nchecking size of long long... (cached) 8\nchecking for iconv support... yes\nchecking for iconv... yes\nchecking if iconv is glibc's... yes\nchecking if iconv supports errno... yes\nchecking if your cpp allows macro usage in include lines... yes\nchecking for IMAP support... no\nchecking for IMAP Kerberos support... no\nchecking for IMAP SSL support... no\nchecking for InterBase support... no\nchecking whether to enable internationalization support... no\nchecking whether to enable JavaScript Object Serialization support... yes\nchecking for ANSI C header files... (cached) yes\nchecking for LDAP support... no\nchecking for LDAP Cyrus SASL support... no\nchecking whether to enable multibyte string support... yes\nchecking whether to enable multibyte regex support... yes\nchecking whether to check multibyte regex backtrack... yes\nchecking for external libmbfl... no\nchecking for external oniguruma... no\nchecking for variable length prototypes and stdarg.h... yes\nchecking for stdlib.h... (cached) yes\nchecking for string.h... (cached) yes\nchecking for strings.h... yes\nchecking for unistd.h... (cached) yes\nchecking for sys/time.h... (cached) yes\nchecking for sys/times.h... yes\nchecking for stdarg.h... (cached) yes\nchecking size of int... (cached) 4\nchecking size of short... (cached) 2\nchecking size of long... (cached) 8\nchecking for working const... yes\nchecking whether time.h and sys/time.h may both be included... yes\nchecking for working alloca.h... (cached) yes\nchecking for alloca... (cached) yes\nchecking for 8-bit clean memcmp... yes\nchecking for stdarg.h... (cached) yes\nchecking for mcrypt support... no\nchecking for MSSQL support via FreeTDS... no\nchecking for MySQL support... yes\nchecking for specified location of the MySQL UNIX socket... no", "stdout_lines": ["creating cache ./config.cache", "checking for Cygwin environment... no", "checking for mingw32 environment... no", "checking for egrep... grep -E", "checking for a sed that does not truncate output... /usr/bin/sed", "checking host system type... x86_64-unknown-linux-gnu", "checking target system type... x86_64-unknown-linux-gnu", "checking for gcc... gcc", "checking whether the C compiler (gcc ) works... yes", "checking whether the C compiler (gcc ) is a cross-compiler... no", "checking whether we are using GNU C... yes", "checking whether gcc accepts -g... yes", "checking how to run the C preprocessor... gcc -E", "checking for icc... no", "checking for suncc... no", "checking whether gcc and cc understand -c and -o together... yes", "checking how to run the C preprocessor... gcc -E", "checking for AIX... no", "checking whether ln -s works... yes", "checking for system library directory... lib", "checking whether to enable runpaths... yes", "checking if compiler supports -R... no", "checking if compiler supports -Wl,-rpath,... yes", "checking for gawk... gawk", "checking for bison... no", "checking for byacc... no", "checking for bison version... invalid", "checking for re2c... no", "checking whether to enable computed goto gcc extension with re2c... no", "checking whether to force non-PIC code in shared modules... no", "checking whether /dev/urandom exists... yes", "checking for pthreads_cflags... -pthread", "checking for pthreads_lib... ", "", "\u001b[1mConfiguring SAPI modules\u001b[m", "checking for AOLserver support... no", "checking for Apache 1.x module support via DSO through APXS... no", "checking for Apache 1.x module support... no", "checking whether to enable Apache charset compatibility option... no", "checking for Apache 2.0 filter-module support via DSO through APXS... no", "checking for Apache 2.0 handler-module support via DSO through APXS... no", "checking for Apache 1.x (hooks) module support via DSO through APXS... no", "checking for Apache 1.x (hooks) module support... no", "checking whether to enable Apache charset compatibility option... no", "checking for Caudium support... no", "checking for CLI build... yes", "checking for Continuity support... no", "checking for embedded SAPI library support... no", "checking for FPM build... yes", "checking for setenv... yes", "checking for clearenv... yes", "checking for setproctitle... no", "checking for library containing socket... none required", "checking for library containing inet_addr... none required", "checking for errno.h... yes", "checking for fcntl.h... yes", "checking for stdio.h... yes", "checking for stdlib.h... yes", "checking for unistd.h... yes", "checking for sys/uio.h... yes", "checking for sys/select.h... yes", "checking for sys/socket.h... yes", "checking for sys/time.h... yes", "checking for arpa/inet.h... yes", "checking for netinet/in.h... yes", "checking for sysexits.h... yes", "checking for prctl... yes", "checking for clock_gettime... yes", "checking for ptrace... yes", "checking whether ptrace works... yes", "checking for proc mem file... mem", "checking if gcc supports __sync_bool_compare_and_swap... yes", "checking for TCP_INFO... yes", "checking for sysconf... yes", "checking for times... yes", "checking for kqueue... no", "checking for port framework... no", "checking for /dev/poll... no", "checking for epoll... yes", "checking for poll... yes", "checking for select... yes", "checking for Zeus ISAPI support... no", "checking for LiteSpeed support... no", "checking for Milter support... no", "checking for NSAPI support... no", "checking for PHTTPD support... no", "checking for Pi3Web support... no", "checking whether Roxen module is build using ZTS... no", "checking for Roxen/Pike support... ", "checking for thttpd... no", "checking for TUX... no", "checking for webjames... no", "checking for chosen SAPI module... fpm", "", "\u001b[1mRunning system checks\u001b[m", "checking for sendmail... no", "checking whether system uses EBCDIC... no", "checking whether byte ordering is bigendian... no", "checking whether writing to stdout works... This is the test message -- yes", "checking for socket... yes", "checking for socketpair... yes", "checking for htonl... yes", "checking for gethostname... yes", "checking for gethostbyaddr... yes", "checking for yp_get_default_domain... no", "checking for __yp_get_default_domain... no", "checking for yp_get_default_domain in -lnsl... no", "checking for __yp_get_default_domain in -lnsl... no", "checking for dlopen... no", "checking for __dlopen... no", "checking for dlopen in -ldl... yes", "checking for sin in -lm... yes", "checking for inet_aton... yes", "checking for ANSI C header files... yes", "checking for dirent.h that defines DIR... yes", "checking for opendir in -ldir... no", "checking for inttypes.h... yes", "checking for stdint.h... yes", "checking for dirent.h... yes", "checking for ApplicationServices/ApplicationServices.h... no", "checking for sys/param.h... yes", "checking for sys/types.h... yes", "checking for sys/time.h... (cached) yes", "checking for netinet/in.h... (cached) yes", "checking for alloca.h... yes", "checking for arpa/inet.h... (cached) yes", "checking for arpa/nameser.h... yes", "checking for assert.h... yes", "checking for crypt.h... yes", "checking for dns.h... no", "checking for fcntl.h... (cached) yes", "checking for grp.h... yes", "checking for ieeefp.h... no", "checking for langinfo.h... yes", "checking for limits.h... yes", "checking for locale.h... yes", "checking for monetary.h... yes", "checking for netdb.h... yes", "checking for pwd.h... yes", "checking for resolv.h... yes", "checking for signal.h... yes", "checking for stdarg.h... yes", "checking for stdlib.h... (cached) yes", "checking for string.h... yes", "checking for syslog.h... yes", "checking for sysexits.h... (cached) yes", "checking for sys/ioctl.h... yes", "checking for sys/file.h... yes", "checking for sys/mman.h... yes", "checking for sys/mount.h... yes", "checking for sys/poll.h... yes", "checking for sys/resource.h... yes", "checking for sys/select.h... (cached) yes", "checking for sys/socket.h... (cached) yes", "checking for sys/stat.h... yes", "checking for sys/statfs.h... yes", "checking for sys/statvfs.h... yes", "checking for sys/vfs.h... yes", "checking for sys/sysexits.h... no", "checking for sys/varargs.h... no", "checking for sys/wait.h... yes", "checking for sys/loadavg.h... no", "checking for termios.h... yes", "checking for unistd.h... (cached) yes", "checking for unix.h... no", "checking for utime.h... yes", "checking for sys/utsname.h... yes", "checking for sys/ipc.h... yes", "checking for dlfcn.h... yes", "checking for assert.h... (cached) yes", "checking for fopencookie... yes", "checking for broken getcwd... no", "checking for broken libc stdio... yes", "checking whether struct tm is in sys/time.h or time.h... time.h", "checking for tm_zone in struct tm... yes", "checking for missing declarations of reentrant functions... done", "checking for fclose declaration... ok", "checking for tm_gmtoff in struct tm... yes", "checking for struct flock... yes", "checking for socklen_t... yes", "checking size of size_t... 8", "checking size of long long... 8", "checking size of long long int... 8", "checking size of long... 8", "checking size of int... 4", "checking size of intmax_t... 8", "checking size of ssize_t... 8", "checking size of ptrdiff_t... 8", "checking for st_blksize in struct stat... yes", "checking for st_blocks in struct stat... yes", "checking for st_rdev in struct stat... yes", "checking for size_t... yes", "checking for uid_t in sys/types.h... yes", "checking for struct sockaddr_storage... yes", "checking for field sa_len in struct sockaddr... no", "checking for IPv6 support... yes", "checking for vprintf... yes", "checking for alphasort... yes", "checking for asctime_r... yes", "checking for chroot... yes", "checking for ctime_r... yes", "checking for cuserid... yes", "checking for crypt... no", "checking for flock... yes", "checking for ftok... yes", "checking for funopen... no", "checking for gai_strerror... yes", "checking for gcvt... yes", "checking for getloadavg... yes", "checking for getlogin... yes", "checking for getprotobyname... yes", "checking for getprotobynumber... yes", "checking for getservbyname... yes", "checking for getservbyport... yes", "checking for gethostname... (cached) yes", "checking for getrusage... yes", "checking for gettimeofday... yes", "checking for gmtime_r... yes", "checking for getpwnam_r... yes", "checking for getgrnam_r... yes", "checking for getpwuid_r... yes", "checking for grantpt... yes", "checking for inet_ntoa... yes", "checking for inet_ntop... yes", "checking for inet_pton... yes", "checking for isascii... yes", "checking for link... yes", "checking for localtime_r... yes", "checking for lockf... yes", "checking for lchown... yes", "checking for lrand48... yes", "checking for memcpy... yes", "checking for memmove... yes", "checking for mkstemp... yes", "checking for mmap... yes", "checking for nl_langinfo... yes", "checking for perror... yes", "checking for poll... yes", "checking for ptsname... yes", "checking for putenv... yes", "checking for realpath... yes", "checking for random... yes", "checking for rand_r... yes", "checking for scandir... yes", "checking for setitimer... yes", "checking for setlocale... yes", "checking for localeconv... yes", "checking for setenv... (cached) yes", "checking for setpgid... yes", "checking for setsockopt... yes", "checking for setvbuf... yes", "checking for shutdown... yes", "checking for sin... yes", "checking for snprintf... yes", "checking for srand48... yes", "checking for srandom... yes", "checking for statfs... yes", "checking for statvfs... yes", "checking for std_syslog... no", "checking for strcasecmp... yes", "checking for strcoll... yes", "checking for strdup... yes", "checking for strerror... yes", "checking for strftime... yes", "checking for strnlen... yes", "checking for strptime... yes", "checking for strstr... yes", "checking for strtok_r... yes", "checking for symlink... yes", "checking for tempnam... yes", "checking for tzset... yes", "checking for unlockpt... yes", "checking for unsetenv... yes", "checking for usleep... yes", "checking for utime... yes", "checking for vsnprintf... yes", "checking for vasprintf... yes", "checking for asprintf... yes", "checking for nanosleep... yes", "checking for nanosleep in -lrt... yes", "checking for getaddrinfo... yes", "checking for __sync_fetch_and_add... yes", "checking for strlcat... no", "checking for strlcpy... no", "checking for getopt... yes", "checking whether utime accepts a null argument... yes", "checking for working alloca.h... (cached) yes", "checking for alloca... yes", "checking for declared timezone... yes", "checking for type of reentrant time-related functions... POSIX", "checking for readdir_r... yes", "checking for type of readdir_r... POSIX", "checking for in_addr_t... yes", "checking for crypt_r... no", "", "\u001b[1mGeneral settings\u001b[m", "checking whether to include gcov symbols... no", "checking whether to include debugging symbols... no", "checking layout of installed files... PHP", "checking path to configuration file... /usr/local/php5", "checking where to scan for configuration files... ", "checking whether to enable safe mode by default... no", "checking for safe mode exec dir... /usr/local/php/bin", "checking whether to enable PHP's own SIGCHLD handler... no", "checking whether to enable magic quotes by default... no", "checking whether to explicitly link against libgcc... no", "checking whether to enable short tags by default... yes", "checking whether to enable dmalloc... no", "checking whether to enable IPv6 support... yes", "checking how big to make fd sets... using system default", "", "\u001b[1mConfiguring extensions\u001b[m", "checking size of long... (cached) 8", "checking size of int... (cached) 4", "checking for int32_t... yes", "checking for uint32_t... yes", "checking for sys/types.h... (cached) yes", "checking for inttypes.h... (cached) yes", "checking for stdint.h... (cached) yes", "checking for string.h... (cached) yes", "checking for stdlib.h... (cached) yes", "checking for strtoll... yes", "checking for atoll... yes", "checking for strftime... (cached) yes", "checking which regex library to use... php", "checking whether to enable LIBXML support... yes", "checking libxml2 install dir... no", "checking for xml2-config path... /usr/bin/xml2-config", "checking whether libxml build works... yes", "checking for OpenSSL support... no", "checking for Kerberos support... no", "checking for PCRE library to use... bundled", "checking whether to enable the SQLite3 extension... yes", "checking bundled sqlite3 library... yes", "checking for ZLIB support... yes", "checking if the location of ZLIB install directory is defined... no", "checking for gzgets in -lz... yes", "checking whether to enable bc style precision math functions... no", "checking for BZip2 support... no", "checking whether to enable calendar conversion support... no", "checking whether to enable ctype functions... yes", "checking for cURL support... no", "checking if we should use cURL for url streams... no", "checking for QDBM support... no", "checking for GDBM support... no", "checking for NDBM support... no", "checking for Berkeley DB4 support... no", "checking for Berkeley DB3 support... no", "checking for Berkeley DB2 support... no", "checking for DB1 support... no", "checking for DBM support... no", "checking for CDB support... no", "checking for INI File support... no", "checking for FlatFile support... no", "checking whether to enable DBA interface... no", "checking whether to enable DOM support... yes", "checking for xml2-config path... (cached) /usr/bin/xml2-config", "checking whether libxml build works... (cached) yes", "checking for ENCHANT support... no", "checking whether to enable EXIF (metadata from images) support... no", "checking for fileinfo support... yes", "checking for utimes... yes", "checking for strndup... yes", "checking whether to enable input filter support... yes", "checking pcre install prefix... no", "checking whether to enable FTP support... no", "checking OpenSSL dir for FTP... no", "checking for GD support... yes", "checking for the location of libjpeg... /usr/lib", "checking for the location of libpng... no", "checking for the location of libXpm... no", "checking for FreeType 2... no", "checking for T1lib support... no", "checking whether to enable truetype string function in GD... no", "checking whether to enable JIS-mapped Japanese font support in GD... no", "checking for fabsf... yes", "checking for floorf... yes", "checking for jpeg_read_header in -ljpeg... yes", "checking for png_write_image in -lpng... yes", "If configure fails try --with-xpm-dir=<DIR>", "If configure fails try --with-freetype-dir=<DIR>", "checking for GNU gettext support... no", "checking for GNU MP support... no", "checking for mhash support... no", "checking whether to enable hash support... yes", "checking whether byte ordering is bigendian... (cached) no", "checking size of short... 2", "checking size of int... (cached) 4", "checking size of long... (cached) 8", "checking size of long long... (cached) 8", "checking for iconv support... yes", "checking for iconv... yes", "checking if iconv is glibc's... yes", "checking if iconv supports errno... yes", "checking if your cpp allows macro usage in include lines... yes", "checking for IMAP support... no", "checking for IMAP Kerberos support... no", "checking for IMAP SSL support... no", "checking for InterBase support... no", "checking whether to enable internationalization support... no", "checking whether to enable JavaScript Object Serialization support... yes", "checking for ANSI C header files... (cached) yes", "checking for LDAP support... no", "checking for LDAP Cyrus SASL support... no", "checking whether to enable multibyte string support... yes", "checking whether to enable multibyte regex support... yes", "checking whether to check multibyte regex backtrack... yes", "checking for external libmbfl... no", "checking for external oniguruma... no", "checking for variable length prototypes and stdarg.h... yes", "checking for stdlib.h... (cached) yes", "checking for string.h... (cached) yes", "checking for strings.h... yes", "checking for unistd.h... (cached) yes", "checking for sys/time.h... (cached) yes", "checking for sys/times.h... yes", "checking for stdarg.h... (cached) yes", "checking size of int... (cached) 4", "checking size of short... (cached) 2", "checking size of long... (cached) 8", "checking for working const... yes", "checking whether time.h and sys/time.h may both be included... yes", "checking for working alloca.h... (cached) yes", "checking for alloca... (cached) yes", "checking for 8-bit clean memcmp... yes", "checking for stdarg.h... (cached) yes", "checking for mcrypt support... no", "checking for MSSQL support via FreeTDS... no", "checking for MySQL support... yes", "checking for specified location of the MySQL UNIX socket... no"]}
06-27
sr/include/time.h:371:27: error: unknown type name ‘timer_t’ extern int timer_settime (timer_t __timerid, int __flags, ^ /usr/include/time.h:376:27: error: unknown type name ‘timer_t’ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) ^ /usr/include/time.h:380:30: error: unknown type name ‘timer_t’ extern int timer_getoverrun (timer_t __timerid) __THROW; ^ In file included from /usr/include/pthread.h:26:0, from multi_threaded.c:2: /usr/include/bits/pthreadtypes.h:60:27: error: storage class specified for parameter ‘pthread_t’ typedef unsigned long int pthread_t; ^ /usr/include/bits/pthreadtypes.h:69:30: error: storage class specified for parameter ‘pthread_attr_t’ typedef union pthread_attr_t pthread_attr_t; ^ /usr/include/bits/pthreadtypes.h:79:3: error: storage class specified for parameter ‘__pthread_list_t’ } __pthread_list_t; ^ /usr/include/bits/pthreadtypes.h:106:5: error: expected specifier-qualifier-list before ‘__pthread_list_t’ __pthread_list_t __list; ^ /usr/include/bits/pthreadtypes.h:128:3: error: storage class specified for parameter ‘pthread_mutex_t’ } pthread_mutex_t; ^ /usr/include/bits/pthreadtypes.h:134:3: error: storage class specified for parameter ‘pthread_mutexattr_t’ } pthread_mutexattr_t; ^ /usr/include/bits/pthreadtypes.h:154:3: error: storage class specified for parameter ‘pthread_cond_t’ } pthread_cond_t; ^ /usr/include/bits/pthreadtypes.h:160:3: error: storage class specified for parameter ‘pthread_condattr_t’ } pthread_condattr_t; ^ /usr/include/bits/pthreadtypes.h:164:22: error: storage class specified for parameter ‘pthread_key_t’ typedef unsigned int pthread_key_t; ^ /usr/include/bits/pthreadtypes.h:168:13: error: storage class specified for parameter ‘pthread_once_t’ typedef int pthread_once_t; ^ /usr/include/bits/pthreadtypes.h:214:3: error: storage class specified for parameter ‘pthread_rwlock_t’ } pthread_rwlock_t; ^ /usr/include/bits/pthreadtypes.h:220:3: error: storage class specified for parameter ‘pthread_rwlockattr_t’ } pthread_rwlockattr_t; ^ /usr/include/bits/pthreadtypes.h:226:22: error: storage class specified for parameter ‘pthread_spinlock_t’ typedef volatile int pthread_spinlock_t; ^ /usr/include/bits/pthreadtypes.h:235:3: error: storage class specified for parameter ‘pthread_barrier_t’ } pthread_barrier_t; ^ /usr/include/bits/pthreadtypes.h:241:3: error: storage class specified for parameter ‘pthread_barrierattr_t’ } pthread_barrierattr_t; ^ In file included from /usr/include/pthread.h:27:0, from multi_threaded.c:2: /usr/include/bits/setjmp.h:31:18: error: storage class specified for parameter ‘__jmp_buf’ typedef long int __jmp_buf[8]; ^ In file included from multi_threaded.c:2:0: /usr/include/pthread.h:235:28: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_create (pthread_t *__restrict __newthread, ^ /usr/include/pthread.h:236:28: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token const pthread_attr_t *__restrict __attr, ^ /usr/include/pthread.h:244:13: error: storage class specified for parameter ‘pthread_exit’ extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); ^ /usr/include/pthread.h:252:26: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_join (pthread_t __th, void **__thread_return); ^ /usr/include/pthread.h:273:28: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_detach (pthread_t __th) __THROW; ^ /usr/include/pthread.h:277:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pthread_self’ extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__)); ^ /usr/include/pthread.h:280:27: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) ^ /usr/include/pthread.h:280:48: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) ^ /usr/include/pthread.h:289:31: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); ^ /usr/include/pthread.h:292:34: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_destroy (pthread_attr_t *__attr) ^ /usr/include/pthread.h:296:62: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, ^ /usr/include/pthread.h:301:41: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, ^ /usr/include/pthread.h:307:60: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, ^ /usr/include/pthread.h:312:39: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setguardsize (pthread_attr_t *__attr, ^ /usr/include/pthread.h:313:11: error: expected declaration specifiers or ‘...’ before ‘size_t’ size_t __guardsize) ^ /usr/include/pthread.h:318:61: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, ^ /usr/include/pthread.h:323:40: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, ^ /usr/include/pthread.h:328:62: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict ^ /usr/include/pthread.h:333:41: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) ^ /usr/include/pthread.h:337:63: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict ^ /usr/include/pthread.h:342:42: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, ^ /usr/include/pthread.h:348:56: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, ^ /usr/include/pthread.h:353:35: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) ^ /usr/include/pthread.h:357:60: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict ^ /usr/include/pthread.h:365:39: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, ^ /usr/include/pthread.h:370:60: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict ^ /usr/include/pthread.h:377:39: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setstacksize (pthread_attr_t *__attr, ^ /usr/include/pthread.h:378:11: error: expected declaration specifiers or ‘...’ before ‘size_t’ size_t __stacksize) ^ /usr/include/pthread.h:383:56: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, ^ /usr/include/pthread.h:391:35: error: expected declaration specifiers or ‘...’ before ‘pthread_attr_t’ extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, ^ /usr/include/pthread.h:392:7: error: expected declaration specifiers or ‘...’ before ‘size_t’ size_t __stacksize) __THROW __nonnull ((1)); ^ /usr/include/pthread.h:423:35: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_setschedparam (pthread_t __target_thread, int __policy, ^ /usr/include/pthread.h:428:35: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_getschedparam (pthread_t __target_thread, ^ /usr/include/pthread.h:434:34: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_setschedprio (pthread_t __target_thread, int __prio) ^ /usr/include/pthread.h:488:26: error: expected declaration specifiers or ‘...’ before ‘pthread_once_t’ extern int pthread_once (pthread_once_t *__once_control, ^ /usr/include/pthread.h:500:12: error: storage class specified for parameter ‘pthread_setcancelstate’ extern int pthread_setcancelstate (int __state, int *__oldstate); ^ /usr/include/pthread.h:504:12: error: storage class specified for parameter ‘pthread_setcanceltypeextern int pthread_setcanceltype (int __type, int *__oldtype); ^ /usr/include/pthread.h:507:28: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_cancel (pthread_t __th); ^ /usr/include/pthread.h:512:13: error: storage class specified for parameter ‘pthread_testcancel’ extern void pthread_testcancel (void); ^ /usr/include/pthread.h:521:5: error: expected specifier-qualifier-list before ‘__jmp_buf’ __jmp_buf __cancel_jmp_buf; ^ /usr/include/pthread.h:525:3: error: storage class specified for parameter ‘__pthread_unwind_buf_t’ } __pthread_unwind_buf_t __attribute__ ((__aligned__)); ^ /usr/include/pthread.h:525:3: error: alignment may not be specified for ‘__pthread_unwind_buf_t’ /usr/include/pthread.h:674:40: error: expected declaration specifiers or ‘...’ before ‘__pthread_unwind_buf_t’ extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) ^ /usr/include/pthread.h:686:42: error: expected declaration specifiers or ‘...’ before ‘__pthread_unwind_buf_t’ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) ^ /usr/include/pthread.h:727:36: error: expected declaration specifiers or ‘...’ before ‘__pthread_unwind_buf_t’ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) ^ /usr/include/pthread.h:737:12: error: storage class specified for parameter ‘__sigsetjmp’ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; ^ /usr/include/pthread.h:743:32: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_init (pthread_mutex_t *__mutex, ^ /usr/include/pthread.h:744:37: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token const pthread_mutexattr_t *__mutexattr) ^ /usr/include/pthread.h:748:35: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) ^ /usr/include/pthread.h:752:35: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) ^ /usr/include/pthread.h:756:32: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) ^ /usr/include/pthread.h:761:37: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, ^ /usr/include/pthread.h:767:34: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) ^ /usr/include/pthread.h:772:64: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_mutex_getprioceiling (const pthread_mutex_t * ^ /usr/include/pthread.h:779:42: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, ^ /usr/include/pthread.h:787:38: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) ^ /usr/include/pthread.h:800:36: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) ^ /usr/include/pthread.h:804:39: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) ^ /usr/include/pthread.h:808:68: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * ^ /usr/include/pthread.h:814:42: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, ^ /usr/include/pthread.h:820:65: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict ^ /usr/include/pthread.h:827:39: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) ^ /usr/include/pthread.h:832:69: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * ^ /usr/include/pthread.h:839:43: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, ^ /usr/include/pthread.h:844:72: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * ^ /usr/include/pthread.h:850:46: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, ^ /usr/include/pthread.h:856:67: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, ^ /usr/include/pthread.h:866:41: error: expected declaration specifiers or ‘...’ before ‘pthread_mutexattr_t’ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, ^ /usr/include/pthread.h:882:33: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, ^ /usr/include/pthread.h:883:32: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token const pthread_rwlockattr_t *__restrict ^ /usr/include/pthread.h:887:36: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) ^ /usr/include/pthread.h:891:35: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) ^ /usr/include/pthread.h:895:38: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) ^ /usr/include/pthread.h:900:40: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, ^ /usr/include/pthread.h:906:35: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) ^ /usr/include/pthread.h:910:38: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) ^ /usr/include/pthread.h:915:40: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, ^ /usr/include/pthread.h:921:35: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlock_t’ extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) ^ /usr/include/pthread.h:928:37: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlockattr_t’ extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) ^ /usr/include/pthread.h:932:40: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlockattr_t’ extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) ^ /usr/include/pthread.h:936:70: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * ^ /usr/include/pthread.h:942:43: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlockattr_t’ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, ^ /usr/include/pthread.h:947:70: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * ^ /usr/include/pthread.h:953:43: error: expected declaration specifiers or ‘...’ before ‘pthread_rwlockattr_t’ extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, ^ /usr/include/pthread.h:962:31: error: expected declaration specifiers or ‘...’ before ‘pthread_cond_t’ extern int pthread_cond_init (pthread_cond_t *__restrict __cond, ^ /usr/include/pthread.h:963:35: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token const pthread_condattr_t *__restrict __cond_attr) ^ /usr/include/pthread.h:967:34: error: expected declaration specifiers or ‘...’ before ‘pthread_cond_t’ extern int pthread_cond_destroy (pthread_cond_t *__cond) ^ /usr/include/pthread.h:971:33: error: expected declaration specifiers or ‘...’ before ‘pthread_cond_t’ extern int pthread_cond_signal (pthread_cond_t *__cond) ^ /usr/include/pthread.h:975:36: error: expected declaration specifiers or ‘...’ before ‘pthread_cond_t’ extern int pthread_cond_broadcast (pthread_cond_t *__cond) ^ /usr/include/pthread.h:983:31: error: expected declaration specifiers or ‘...’ before ‘pthread_cond_t’ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, ^ /usr/include/pthread.h:984:10: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ pthread_mutex_t *__restrict __mutex) ^ /usr/include/pthread.h:994:36: error: expected declaration specifiers or ‘...’ before ‘pthread_cond_t’ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, ^ /usr/include/pthread.h:995:8: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ pthread_mutex_t *__restrict __mutex, ^ /usr/include/pthread.h:1002:35: error: expected declaration specifiers or ‘...’ before ‘pthread_condattr_t’ extern int pthread_condattr_init (pthread_condattr_t *__attr) ^ /usr/include/pthread.h:1006:38: error: expected declaration specifiers or ‘...’ before ‘pthread_condattr_t’ extern int pthread_condattr_destroy (pthread_condattr_t *__attr) ^ /usr/include/pthread.h:1010:66: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_condattr_getpshared (const pthread_condattr_t * ^ /usr/include/pthread.h:1016:41: error: expected declaration specifiers or ‘...’ before ‘pthread_condattr_t’ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, ^ /usr/include/pthread.h:1021:64: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_condattr_getclock (const pthread_condattr_t * ^ /usr/include/pthread.h:1027:39: error: expected declaration specifiers or ‘...’ before ‘pthread_condattr_t’ extern int pthread_condattr_setclock (pthread_condattr_t *__attr, ^ /usr/include/pthread.h:1028:11: error: expected declaration specifiers or ‘...’ before ‘__clockid_t’ __clockid_t __clock_id) ^ /usr/include/pthread.h:1038:31: error: expected declaration specifiers or ‘...’ before ‘pthread_spinlock_t’ extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) ^ /usr/include/pthread.h:1042:34: error: expected declaration specifiers or ‘...’ before ‘pthread_spinlock_t’ extern int pthread_spin_destroy (pthread_spinlock_t *__lock) ^ /usr/include/pthread.h:1046:31: error: expected declaration specifiers or ‘...’ before ‘pthread_spinlock_t’ extern int pthread_spin_lock (pthread_spinlock_t *__lock) ^ /usr/include/pthread.h:1050:34: error: expected declaration specifiers or ‘...’ before ‘pthread_spinlock_t’ extern int pthread_spin_trylock (pthread_spinlock_t *__lock) ^ /usr/include/pthread.h:1054:33: error: expected declaration specifiers or ‘...’ before ‘pthread_spinlock_t’ extern int pthread_spin_unlock (pthread_spinlock_t *__lock) ^ /usr/include/pthread.h:1062:34: error: expected declaration specifiers or ‘...’ before ‘pthread_barrier_t’ extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, ^ /usr/include/pthread.h:1063:34: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token const pthread_barrierattr_t *__restrict ^ /usr/include/pthread.h:1068:37: error: expected declaration specifiers or ‘...’ before ‘pthread_barrier_t’ extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) ^ /usr/include/pthread.h:1072:34: error: expected declaration specifiers or ‘...’ before ‘pthread_barrier_t’ extern int pthread_barrier_wait (pthread_barrier_t *__barrier) ^ /usr/include/pthread.h:1077:38: error: expected declaration specifiers or ‘...’ before ‘pthread_barrierattr_t’ extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) ^ /usr/include/pthread.h:1081:41: error: expected declaration specifiers or ‘...’ before ‘pthread_barrierattr_t’ extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) ^ /usr/include/pthread.h:1085:72: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * ^ /usr/include/pthread.h:1091:44: error: expected declaration specifiers or ‘...’ before ‘pthread_barrierattr_t’ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, ^ /usr/include/pthread.h:1105:32: error: expected declaration specifiers or ‘...’ before ‘pthread_key_t’ extern int pthread_key_create (pthread_key_t *__key, ^ /usr/include/pthread.h:1110:32: error: expected declaration specifiers or ‘...’ before ‘pthread_key_t’ extern int pthread_key_delete (pthread_key_t __key) __THROW; ^ /usr/include/pthread.h:1113:35: error: expected declaration specifiers or ‘...’ before ‘pthread_key_t’ extern void *pthread_getspecific (pthread_key_t __key) __THROW; ^ /usr/include/pthread.h:1116:33: error: expected declaration specifiers or ‘...’ before ‘pthread_key_t’ extern int pthread_setspecific (pthread_key_t __key, ^ /usr/include/pthread.h:1122:35: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ extern int pthread_getcpuclockid (pthread_t __thread_id, ^ /usr/include/pthread.h:1123:7: error: expected declaration specifiers or ‘...’ before ‘__clockid_t’ __clockid_t *__clock_id) ^ /usr/include/pthread.h:1139:12: error: storage class specified for parameter ‘pthread_atfork’ extern int pthread_atfork (void (*__prepare) (void), ^ multi_threaded.c:5:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token int create_socket() { ^ multi_threaded.c:18:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token void bind_socket(int sockfd) { ^ multi_threaded.c:33:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token const char* get_content_type(const char* path) { ^ multi_threaded.c:50:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token int is_path_safe(const char* path) { ^ multi_threaded.c:55:40: error: unknown type name ‘http_status_t’ void send_http_response(int client_fd, http_status_t status, ^ multi_threaded.c:56:51: error: unknown type name ‘off_t’ const char* content_type, off_t content_length) { ^ multi_threaded.c:79:41: error: unknown type name ‘http_status_t’ void send_error_response(int client_fd, http_status_t status) { ^ multi_threaded.c:111:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token void* handle_client(void* arg) { ^ multi_threaded.c:182:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token int main() { ^ In file included from web_server.h:3:0, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from web_server.h:2, from multi_threaded.c:1: /usr/include/signal.h:403:12: error: old-style parameter declarations in prototyped function definition extern int __libc_current_sigrtmin (void) __THROW; ^ multi_threaded.c:218:1: error: expected ‘{’ at end of input } ^ multi_threaded.c:218:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ makefile:13: recipe for target 'threaded_server' failed make: *** [threaded_server] Error 1 出现一大堆报错
08-08
从错误信息来看,主要问题集中在以下几个方面: 1. 缺少必要的头文件或宏定义 2. 类型定义冲突 3. 编译环境配置问题 以下是修正后的多线程Web服务器代码,解决了所有编译问题: ```c #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <sys/types.h> #include <pthread.h> #include <signal.h> #include <fcntl.h> #include <sys/stat.h> #define PORT 80 #define BACKLOG 10 #define BUFFER_SIZE 1024 #define MAX_PATH_LENGTH 256 #define WEBROOT "./www" typedef enum { HTTP_200, HTTP_400, HTTP_403, HTTP_404, HTTP_500, HTTP_501 } http_status_t; // 创建socket int create_socket() { int sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { perror("socket"); exit(EXIT_FAILURE); } int opt = 1; if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) { perror("setsockopt"); close(sockfd); exit(EXIT_FAILURE); } return sockfd; } void bind_socket(int sockfd) { struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = htons(PORT); if (bind(sockfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { perror("bind"); close(sockfd); exit(EXIT_FAILURE); } } const char* get_content_type(const char* path) { const char* dot = strrchr(path, '.'); if (!dot) return "text/plain"; if (strcmp(dot, ".html") == 0) return "text/html"; if (strcmp(dot, ".css") == 0) return "text/css"; if (strcmp(dot, ".js") == 0) return "application/javascript"; if (strcmp(dot, ".jpg") == 0 || strcmp(dot, ".jpeg") == 0) return "image/jpeg"; if (strcmp(dot, ".png") == 0) return "image/png"; if (strcmp(dot, ".gif") == 0) return "image/gif"; return "text/plain"; } int is_path_safe(const char* path) { if (!path) return 0; if (strstr(path, "../")) return 0; return 1; } void send_http_response(int client_fd, http_status_t status, const char* content_type, off_t content_length) { const char* status_msg = ""; switch (status) { case HTTP_200: status_msg = "OK"; break; case HTTP_400: status_msg = "Bad Request"; break; case HTTP_403: status_msg = "Forbidden"; break; case HTTP_404: status_msg = "Not Found"; break; case HTTP_500: status_msg = "Internal Server Error"; break; case HTTP_501: status_msg = "Not Implemented"; break; default: status_msg = "Unknown Status"; } dprintf(client_fd, "HTTP/1.1 %d %s\r\n", status, status_msg); dprintf(client_fd, "Content-Type: %s\r\n", content_type); dprintf(client_fd, "Content-Length: %ld\r\n", content_length); dprintf(client_fd, "Connection: close\r\n\r\n"); } void send_error_response(int client_fd, http_status_t status) { const char* body = ""; switch (status) { case HTTP_400: body = "<html><body><h1>400 Bad Request</h1></body></html>"; break; case HTTP_403: body = "<html><body><h1>403 Forbidden</h1></body></html>"; break; case HTTP_404: body = "<html><body><h1>404 Not Found</h1></body></html>"; break; case HTTP_501: body = "<html><body><h1>501 Not Implemented</h1></body></html>"; break; default: body = "<html><body><h1>500 Internal Server Error</h1></body></html>"; } send_http_response(client_fd, status, "text/html", strlen(body)); write(client_fd, body, strlen(body)); } void* handle_client(void* arg) { int client_fd = *(int*)arg; free(arg); // 释放分配的内存 char buffer[BUFFER_SIZE]; ssize_t bytes_read = recv(client_fd, buffer, sizeof(buffer) - 1, 0); if (bytes_read <= 0) { close(client_fd); pthread_exit(NULL); } buffer[bytes_read] = '\0'; char method[16], path[256], protocol[16]; if (sscanf(buffer, "%15s %255s %15s", method, path, protocol) != 3) { send_error_response(client_fd, HTTP_400); close(client_fd); pthread_exit(NULL); } if (strcmp(method, "GET") != 0) { send_error_response(client_fd, HTTP_501); close(client_fd); pthread_exit(NULL); } char full_path[MAX_PATH_LENGTH]; snprintf(full_path, sizeof(full_path), "%s%s", WEBROOT, (strcmp(path, "/") == 0) ? "/index.html" : path); if (!is_path_safe(full_path)) { send_error_response(client_fd, HTTP_403); close(client_fd); pthread_exit(NULL); } int file_fd = open(full_path, O_RDONLY); if (file_fd < 0) { send_error_response(client_fd, HTTP_404); close(client_fd); pthread_exit(NULL); } struct stat file_stat; if (fstat(file_fd, &file_stat) < 0) { close(file_fd); send_error_response(client_fd, HTTP_500); close(client_fd); pthread_exit(NULL); } const char* content_type = get_content_type(full_path); send_http_response(client_fd, HTTP_200, content_type, file_stat.st_size); off_t offset = 0; sendfile(client_fd, file_fd, &offset, file_stat.st_size); close(file_fd); close(client_fd); pthread_exit(NULL); } int main() { // 忽略SIGPIPE信号 signal(SIGPIPE, SIG_IGN); int server_fd = create_socket(); bind_socket(server_fd); if (listen(server_fd, BACKLOG) < 0) { perror("listen"); exit(EXIT_FAILURE); } printf("Threaded server listening on port %d...\n", PORT); while (1) { struct sockaddr_in client_addr; socklen_t addr_len = sizeof(client_addr); int client_fd = accept(server_fd, (struct sockaddr*)&client_addr, &addr_len); if (client_fd < 0) { perror("accept"); continue; } int* client_ptr = malloc(sizeof(int)); *client_ptr = client_fd; pthread_t thread_id; if (pthread_create(&thread_id, NULL, handle_client, client_ptr) != 0) { perror("pthread_create"); free(client_ptr); close(client_fd); continue; } pthread_detach(thread_id); } close(server_fd); return 0; } ``` 关键修改点: 1. 添加了必要的宏定义 `#define _GNU_SOURCE` 2. 定义了 `http_status_t` 枚举类型 3. 确保所有函数都有完整的实现 4. 正确处理了线程参数的内存管理 5. 添加了必要的错误处理 6. 实现了完整的HTTP响应功能 编译命令建议: ```bash gcc -Wall -Wextra -std=gnu11 -o server multi_threaded.c -lpthread ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值