LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 08-02-2002, 05:26 PM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

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: 473

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

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


Reply



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



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

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration