LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-21-2006, 02:54 AM   #1
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
poepn or system function call executed by a background process


hi all,

am developing a server which runs as a background process without any controlling terminal...

when there is any request from client, server should make use of popen or system function call to check whether a process is running or not and send back the status to the client ...

when the server is run in foreground with controlling terminal everything is fine, but when the same server is run as a background process without any controlling terminal i have the following problem encountered

during the popen call or system call program is receiving SIGSEGV
and from truss of the program following is received

ioctl(2, TCGETA, 0xFFBFE4C4) Err#25 ENOTTY
4342: Incurred fault #6, FLTBOUNDS %pc = 0xFF1B44E4
4342: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
4342: Received signal #11, SIGSEGV [caught]
4342: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000


any pointers on this ?
is there any way to handle this ?

thanks for your help in advance ...
 
Old 08-24-2006, 03:04 AM   #2
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Original Poster
Rep: Reputation: 30
the reason for crash is i used getlogin

when a process without controlling terminal uses getlogin NULL pointer will be returned. Using NULL pointer with sprintf and further system commnand execution would crash...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System call to get current process memory usage? mattengland Programming 4 03-15-2006 07:07 PM
When does process swap happen in a system call? oldfogie Programming 3 05-03-2005 07:35 PM
is there a system call to send process to run in the background? feetyouwell Programming 4 10-01-2004 04:58 AM
run process in background using system calls indian Programming 2 08-10-2004 05:03 PM
Changing Process Priority in Linux w/ System Call sptchamp Programming 2 07-21-2004 09:58 AM


All times are GMT -5. The time now is 06:47 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration