LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
LinkBack Search this Thread
Old 08-02-2002, 05:26 PM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 468

Rep: Reputation: 30
getppid question for BSD users


hi There,
I was just curious to know why getppid works differently on two
different machines.

The manpage for getppid says that it returns the process ID of the parent of the calling process.

if( fork() == 0) // child proc
{
cout<<"Child id "<<getpid()<<endl<<"Parentid "<<getppid()<<endl;
return 0;
}

cout<<"Main : "<<getpid()<<endl;

came up with

>Main : 91555
Child id 91556
Parentid 1 <-- This should have been 91555

I was wondering if the output is similar on your machines.

ON my other machine, it worked just fine. It gave right answer.

Any clues why it is not working on BSD?
 
Old 08-05-2002, 01:59 AM   #2
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 468

Original Poster
Rep: Reputation: 30
Well, I got the answer

Ignore the earlier post. I got the answer to the problem.
 
  


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
Are BSD users allowed here? nweeks LinuxQuestions.org Member Intro 4 01-05-2005 07:16 PM
Hello BSD users! nautilus_1987 *BSD 1 03-20-2004 03:29 PM
root users on bsd... scoob8000 *BSD 8 10-20-2003 06:23 AM
Free Bsd Users Mag|c *BSD 2 04-27-2003 03:10 AM
calling all BSD users.... theneoprotocol Linux - General 1 04-12-2002 06:37 PM


All times are GMT -5. The time now is 07:23 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