- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Passing file descriptor to an unrelated process us...
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-20-2004 09:03 AM
тАО04-20-2004 09:03 AM
Passing file descriptor to an unrelated process using sendmsg call
I tried to pass an open file descriptor to a process (that is not a child of the current one i.e unrelated) using sendmsg call by filling the ancillary data structure cmsghdr. It is a simple program where a child process opens the file and passes it to the parent process. parent starts reading from it. The code works on Linux but on HP-UX, the sendmsg call fails saying EBADF: Bad file number error. The source code for the program is attached as modi_sendrcv_fd.c
I would like to know whether this feature of passing descriptors is possible in HP-UX. We need this for passing socket connection descriptor between unrelated processes. Please respond to this if there any suggestions.
Thanks
Kiran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2015 04:47 AM
тАО03-13-2015 04:47 AM
Re: Passing file descriptor to an unrelated process using sendmsg call
Hello,
If you use the old POSIX1995 API (compile with -D_POSIX_C_SOURCE=199506L) it will work.
The api is also much simpler you just pass the file descriptor as msg_aarights,e.g.
#if _POSIX_VERSION < 200112L
msg.msg_accrights = (caddr_t)&passfd;
msg.msg_accrightslen = sizeof(passfd);
#else
But with POSIX 2001 and using ancillary data I have the same issue.
Did anyone manage to solve the issue with POSIX2001 on HPUX ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2017 10:16 AM
тАО03-27-2017 10:16 AM
Re: Passing file descriptor to an unrelated process using sendmsg call
Hi,
Any chance that someone solve it?
How do I need to call sendmsg using ancillary data?