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(2)					      BSD System Calls Manual						  CLOCK_SETTIME(2)

NAME
clock_settime, clock_gettime, clock_getres -- clock and timer functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#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 clock identified by clock_id to the absolute time specified by tp. If the time specified by tp is not a multiple of the resolution of the clock, tp is truncated to a multiple of the resolution. The clock_gettime() function stores the time of the clock identified by clock_id into the location specified by tp. The clock_getres() function stores the resolution of the clock identified by clock_id into the location specified by res, unless res is NULL. A clock_id of CLOCK_REALTIME identifies the realtime clock for the system. For this clock, the values specified by clock_settime() and obtained by clock_gettime() represent the amount of time (in seconds and nanoseconds) since 00:00 Universal Coordinated Time, January 1, 1970. A clock_id of CLOCK_MONOTONIC identifies a clock that increases at a steady rate (monotonically). This clock is not affected by calls to adjtime(2) and settimeofday(2) and will fail with an EINVAL error if it's the clock specified in a call to clock_settime(). The origin of the clock is unspecified. If the calling user is not the super-user, then the clock_settime() function in the standard C library will try to use the clockctl(4) device if present, thus making possible for non privileged users to set the system time. If clockctl(4) is not present or not accessible, then clock_settime() reverts to the clock_settime() system call, which is restricted to the super user. RETURN VALUES
A value of 0 is returned on success. Otherwise, a value of -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 function is not supported by this implementation. The clock_settime() function will fail if: [EINVAL] The tp argument is outside the range for the specified clock, clock_id. [EINVAL] The tp argument specified a nanosecond value less than zero of greater than or equal 1000 million. [EINVAL] The clock_id argument is a clock that can not be adjusted. [EPERM] The calling process does not have the appropriate privilege to set the specified clock, clock_id. The clock_gettime() function will fail if: [EFAULT] The tp argument specifies an address that is not a valid part of the process address space. SEE ALSO
ctime(3), time(3), clockctl(4) STANDARDS
The clock_settime(), clock_gettime() and clock_getres() functions conform to IEEE Std 1003.1b-1993 (``POSIX.1''). BSD
February 11, 1999 BSD
All times are GMT -4. The time now is 10:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy