Sponsored Content
Top Forums Programming problem with accept() on Fedora 8 Post 302158472 by Akimaki on Tuesday 15th of January 2008 12:06:08 PM
Old 01-15-2008
well the code is quite robust so i skip pasting here even pieces of it but i put together a little test where i just spawned a thread which created a socket and called accept. then in the main i waited a few sec and closed the socket and joined the thread. i debugged it and of course it stucked on accept().

Code:
uname({sys="Linux", node="hal9000", ...}) = 0
futex(0x3012adc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
brk(0)                                  = 0x9065000
brk(0x9086000)                          = 0x9086000
clock_gettime(CLOCK_REALTIME, {1200419840, 211248690}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 211319847}) = 0
open("/dev/urandom", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffe8bbc) = -1 EINVAL (Invalid argument)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f3a000
read(3, "\310\foW^R\270\212\315\227\323\250\215\275\235z\267\336\263}\261\0\227\261\275\344\302\201\351\226,H"..., 4096) = 4096
close(3)                                = 0
munmap(0xb7f3a000, 4096)                = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f3a000
clock_gettime(CLOCK_REALTIME, {1200419840, 213952202}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 214048675}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 214158273}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 214242900}) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(6111), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
setsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=1, linger=0}, 8) = 0
ioctl(3, FIONBIO, [0])                  = 0
mmap2(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7524000
mprotect(0xb7524000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb7f244a4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7f24bd8, {entry_number:6, base_addr:0xb7f24b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7f24bd8) = 19928
clock_gettime(CLOCK_REALTIME, {1200419840, 215085087}) = 0
write(1, "starting..(0 s) [test] started o"..., 44) = 44
nanosleep({3, 0}, {0, 1132736})         = 0
close(3)                                = 0
futex(0xb7f24bd8, FUTEX_WAIT, 19928, NULL) = ? ERESTARTSYS (To be restarted)

i'am pretty sure it's something with fedora cause this software have successfully ran on a whole bunch of various platforms.
 

10 More Discussions You Might Find Interesting

1. HP-UX

accept problem

Hi, there On HP-UX IA server, when calling 'accept' function in my program, the server never wait the client's connection. Each time, it accepted the request from IP address 0.0.0.0 even there is no client's connection. The server program looks like : main() { . . .... (4 Replies)
Discussion started by: Frank2004
4 Replies

2. Shell Programming and Scripting

Urgent problem with SIGCONT and Fedora 4 :(

Hello, I stop a process with kill -s SIGSTOP, but when I try to restart it with kill -s SIGCONT it do nothing. I use Fedora Core 4. Thank you a lot (1 Reply)
Discussion started by: Nene
1 Replies

3. Gentoo

fedora problem

HI, I installed fedora core 6 on my inspiron 1501. After I boot it gives me the following error, PCI: BIOS BUG #81(00000000) found. (1 Reply)
Discussion started by: linuxuser
1 Replies

4. Linux

fedora core 6 problem

hi all i am currently using fedora core 3 . i downloaded the iso image of fedora core 6 but after installing the fedora core 6 . while starting linux it gives a error saying init is been killed . wht is happened? thank u (3 Replies)
Discussion started by: nageshrk
3 Replies

5. Linux

Problem about Fedora directory permission

Problem about Fedora directory permission,can anyone help me? In fedora,I have two ordinary user named user1&user2 in different groups,when I logined user1 and created a dir named test/ in '/home/ user1/',and do 'chmod 750 test',so when 'ls -l',it appears 'drwxr- x---' for 'test',but when I... (3 Replies)
Discussion started by: zhouq3132
3 Replies

6. Red Hat

Problem installing perlcc in fedora 9

Hi guys i installed fedora 9 in my system. i installed perl-devel rpm and perl-5.10.0 rpm. But perlcc not in /usr/bin/ directory.But perl,perldoc binaris installed. i am new one for linux. (3 Replies)
Discussion started by: viveksnv
3 Replies

7. SuSE

Fedora 9 problem

I appeal to all those of you that have experience with Fedora 9 for help. I am trying to install a suite of software which tries to make changes to the /etc/dhcpd.conf file. After the changes have been made the dhcpd service will not start and the original conf file is restored. However dhcpd... (1 Reply)
Discussion started by: johnf
1 Replies

8. Linux

Problem mounting extern hd (fedora 9)

Hi there, I'm having a bit of a strange problem which I would appreciate some help with. The Problem: I have two external hard drives, but I'm borrowing one off my parents to copy data too (one of mine, which is identical to theirs - WD MyBook 300g - is on its way out). Fedora 9 recognizes... (3 Replies)
Discussion started by: lasthidingplace
3 Replies

9. Red Hat

Problem booting Fedora 11 x86_64

Hi, I am having booting issue with Fedora 11 x86_64 (64-bit version) on my laptop. Laptop configuration is as below: OS : Windows Vista Home Premium (64-bit) Processor : Intel Core 2 Duo T6400 2.0 GHz RAM : 4 GB Tried following different way for installation: 1. Installed Fedora 11 on... (2 Replies)
Discussion started by: r2kv2k
2 Replies

10. Linux

Problem with CRONTAB on Fedora and CentOS

Hello, Can anyone please explain HOW Crontab i.e. job scheduling daemon works in Fedora and CentOS or any Linux platform(Ubuntu).... What are the points that i have to take care of if have to include a script to be run at a specific scheduled time. URGENT reply requested. Please help (1 Reply)
Discussion started by: Vabiosis
1 Replies
clock_settime(3RT)					    Realtime Library Functions						clock_settime(3RT)

NAME
clock_settime, clock_gettime, clock_getres - high-resolution clock operations SYNOPSIS
cc [ flag... ] file... -lrt [ library... ] #include <time.h> int clock_settime(clockid_t clock_id, const struct timespec *tp); int clock_gettime(clockid_t clock_id, struct timespec *tp); int clock_getres(clockid_t clock_id, struct timespec *res); DESCRIPTION
The clock_settime() function sets the specified clock, clock_id, to the value specified by tp. Time values that are between two consecutive non-negative integer multiples of the resolution of the specified clock are truncated down to the smaller multiple of the resolution. The clock_gettime() function returns the current value tp for the specified clock, clock_id. The resolution of any clock can be obtained by calling clock_getres(). Clock resolutions are system-dependent and cannot be set by a process. If the argument res is not NULL, the resolution of the specified clock is stored in the location pointed to by res. If res is NULL, the clock resolution is not returned. If the time argument of clock_settime() is not a multiple of res, then the value is truncated to a multiple of res. A clock may be systemwide (that is, visible to all processes) or per-process (measuring time that is meaningful only within a process). A clock_id of CLOCK_REALTIME is defined in <time.h>. This clock represents the realtime clock for the system. For this clock, the values returned by clock_gettime() and specified by clock_settime() represent the amount of time (in seconds and nanoseconds) since the Epoch. Additional clocks may also be supported. The interpretation of time values for these clocks is unspecified. A clock_id of CLOCK_HIGHRES represents the non-adjustable, high-resolution clock for the system. For this clock, the value returned by clock_gettime(3RT) represents the amount of time (in seconds and nanoseconds) since some arbitrary time in the past; it is not correlated in any way to the time of day, and thus is not subject to resetting or drifting by way of adjtime(2), ntp_adjtime(2), settimeofday(3C), or clock_settime(). The time source for this clock is the same as that for gethrtime(3C). Additional clocks may also be supported. The interpretation of time values for these clocks is unspecified. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The clock_settime(), clock_gettime() and clock_getres() functions will fail if: EINVAL The clock_id argument does not specify a known clock. ENOSYS The functions clock_settime(), clock_gettime(), and clock_getres() are not supported by this implementation. The clock_settime() function will fail if: EINVAL The tp argument to clock_settime() is outside the range for the given clock ID; or the tp argument specified a nanosecond value less than zero or greater than or equal to 1000 million. The clock_settime() function may fail if: EPERM The requesting process does not have the appropriate privilege to set the specified clock. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-------------------------------------+ |Interface Stability |Standard | +-----------------------------+-------------------------------------+ |MT-Level |clock_gettime() is Async-Signal-Safe | +-----------------------------+-------------------------------------+ SEE ALSO
time(2), ctime(3C), gethrtime(3C), time.h(3HEAD), timer_gettime(3RT), attributes(5), standards(5) SunOS 5.10 28 Jun 2002 clock_settime(3RT)
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy