Skip to content

Native build fails to build because of pnet module #793

@miri64

Description

@miri64

Since pnet redefines unistd.h native fails to build on some machines.
An example is trying to build the 6LoWPAN plugtests from des-testbed/RIOT-projects#97:

make -B clean all
[…]
make[1]: Betrete Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/boards/native'
make[2]: Betrete Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/boards/native/drivers'
native-uart0.c: In function ‘uart0_puts’:
native-uart0.c:60:17: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
                 (nwritten = write(
                 ^
native-uart0.c: In function ‘init_unix_socket’:
native-uart0.c:151:5: warning: implicit declaration of function ‘getpid’ [-Wimplicit-function-declaration]
     snprintf(sa.sun_path, sizeof(sa.sun_path), "/tmp/riot.tty.%d", getpid());
     ^
native-uart0.c:152:5: warning: implicit declaration of function ‘unlink’ [-Wimplicit-function-declaration]
     unlink(sa.sun_path); /* remove stale socket */
     ^
native-uart0.c: In function ‘handle_uart_in’:
native-uart0.c:171:5: warning: implicit declaration of function ‘read’ [-Wimplicit-function-declaration]
     nread = read(STDIN_FILENO, buf, sizeof(buf));
     ^
native-uart0.c:179:17: warning: implicit declaration of function ‘dup2’ [-Wimplicit-function-declaration]
                 if (dup2(_native_null_out_file, STDOUT_FILENO) == -1) {
                 ^
make[2]: Verlasse Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/boards/native/drivers'
make[1]: Verlasse Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/boards/native'
"make" -C /home/martin/Repositories/RIOT-OS/RIOT
make[1]: Betrete Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT'
mkdir -p /home/martin/Repositories/RIOT-OS/projects/6lpplugtest/bin/native/
make[2]: Betrete Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/cpu/native'
irq_cpu.c: In function ‘native_interrupt_init’:
irq_cpu.c:507:5: warning: implicit declaration of function ‘pipe’ [-Wimplicit-function-declaration]
     if (pipe(_sig_pipefd) == -1) {
     ^
native_cpu.c: In function ‘reboot’:
native_cpu.c:69:5: warning: implicit declaration of function ‘execve’ [-Wimplicit-function-declaration]
     if (execve(_native_argv[0], _native_argv, NULL) == -1) {
     ^
startup.c: In function ‘_native_null_in’:
startup.c:54:5: warning: implicit declaration of function ‘pipe’ [-Wimplicit-function-declaration]
     if (pipe(_native_null_in_pipe) == -1) {
     ^
startup.c:62:5: warning: implicit declaration of function ‘dup2’ [-Wimplicit-function-declaration]
     if (dup2(_native_null_in_pipe[0], STDIN_FILENO) == -1) {
     ^
startup.c: In function ‘_native_log_stdout’:
startup.c:88:9: warning: implicit declaration of function ‘getpid’ [-Wimplicit-function-declaration]
         snprintf(stdout_logname, sizeof(stdout_logname), "/tmp/riot.stdout.%d", getpid());
         ^
startup.c: In function ‘daemonize’:
startup.c:141:5: warning: implicit declaration of function ‘fork’ [-Wimplicit-function-declaration]
     if ((pid = fork()) == -1) {
     ^
[…]
tap.c: In function ‘send_buf’:
tap.c:222:5: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
     if ((nsent = write(_native_tap_fd, buf, to_send)) == -1) {;
     ^
tap.c: In function ‘tap_init’:
tap.c:308:5: warning: implicit declaration of function ‘getpid’ [-Wimplicit-function-declaration]
     if (fcntl(_native_tap_fd, F_SETOWN, getpid()) == -1) {
     ^
make[3]: *** [/home/martin/Repositories/RIOT-OS/projects/6lpplugtest/bin/native/tap.o] Fehler 1
make[3]: Verlasse Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/cpu/native/net'
make[2]: *** [all] Fehler 2
make[2]: Verlasse Verzeichnis '/home/martin/Repositories/RIOT-OS/RIOT/cpu/native'
[…]

Metadata

Metadata

Labels

Platform: nativePlatform: This PR/issue effects the native platformType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions