lkml.org 
[lkml]   [2003]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject2.6-test6: nanosleep+SIGCONT weirdness
Date
I observe some strange behaviour in 2.6-test6 with this small program:

n.c
===
#include <sys/time.h>
#include <errno.h>
int main(int argc, char* argv[]) {
struct timespec t = { 5000,0};
while(nanosleep(&t,&t)<0) {
puts("Yeah");
if(errno!=EINTR) break;
}
return 0;
}

In 2.4 stracing it while doing killall -CONT ./n works fine:

# strace ./n
execve("./n", ["./n", "5000"], [/* 23 vars */]) = 0
nanosleep({5000, 0}, 0xbffffd54) = -1 EINTR (Interrupted system
call)
--- SIGCONT (Continued) ---
write(1, "Yeah", 4Yeah) = 4
write(1, "\n", 1
) = 1
nanosleep({4994, 730000000}, 0xbffffd54) = -1 EINTR (Interrupted system
call)
--- SIGCONT (Continued) ---
write(1, "Yeah", 4Yeah) = 4
write(1, "\n", 1
) = 1
nanosleep({4994, 280000000}, 0xbffffd54) = -1 EINTR (Interrupted system
call)
--- SIGCONT (Continued) ---
write(1, "Yeah", 4Yeah) = 4
write(1, "\n", 1
) = 1
nanosleep({4993, 930000000},

But in 2.6 it does this:

# strace ./n
execve("./n", ["./n", "400"], [/* 26 vars */]) = 0
nanosleep({5000, 0}, 0xbffffc44) = -1 ERRNO_516 (errno 516)
--- SIGCONT (Continued) ---
setup() = -1 EFAULT (Bad address)
--- SIGCONT (Continued) ---
write(1, "Yeah", 4Yeah) = 4
write(1, "\n", 1
) = 1
_exit(0) = ?
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:2.574 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site