- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Function getpid
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2008 10:54 AM
тАО04-02-2008 10:54 AM
Function getpid
Anybody aware of a change about the getpid function ?
regards,
Marco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2008 05:22 PM
тАО04-02-2008 05:22 PM
Re: Function getpid
getpid is an essential system service, used by _everything_.
It it there, it works.
" I can't compile anymore "
Please qualify / quantify.
What is stoppping you from compiling?
Did you forget how?
Are you getting an error?
Some programs? All programs?
Which error? (Please cut&paste, details may matter)
I guess it complains about getpid... exactly what message?
Take a babystep...
Create and compile the following 'program'
----- test.c -------------
#include
#include
main () {
pid_t pid, ppid;
pid = getpid();
ppid = getppid();
printf ("Parent = %d, Pid = %d\n", ppid, pid);
}
--------------------
# cc test.c
# ./a.out
Parent = 16024, Pid = 16433
# ps
PID TTY TIME COMMAND
16479 pts/tg 0:00 ps
16024 pts/tg 0:00 sh
Does that work for you?
If so, you can compile, and getpid does work!
Hope this helps to get you going,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 03:49 AM
тАО04-03-2008 03:49 AM
Re: Function getpid
great answer but the only line needed was #include
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 03:51 AM
тАО04-03-2008 03:51 AM
Re: Function getpid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 04:20 AM
тАО04-03-2008 04:20 AM
Re: Function getpid
> #include
Hein: Well, duh. If your psychic powers
were good for anything, you'd've know that,
and you could've saved us all a lot of time.
Be smarter next time, will you?
MmC: Next time, try "man getpid":
[...]
SYNOPSIS
#include
[...]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 04:34 AM
тАО04-03-2008 04:34 AM
Re: Function getpid
I'm at a loss to explain why this would fail since getpid(2) returns pid_t which is the default (int) and has a void parm.
>Next time, try "man getpid":
Exactly. Or use compiler options that make missing prototypes an error.
In fact if you try to call malloc in 64 bit, the aCC6 compiler will give an error if a prototype is missing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 08:47 AM
тАО04-03-2008 08:47 AM
Re: Function getpid
> fail [...]
You appear to assume that "I can't compile"
implies an actual failure to compile. With
evidence this sparse, that entails some risk.
Or, as Mr. Sumner advised Bunny in "Desk
Set", "Never assume."