|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to send file descriptor by shared memory
I find from Stivenson (Advanced Programming Unix Environment) "How to send file descriptor by system queue"
I make next code PHP Code:
But if I open new file (descriptor number 3) on the next programm (who is receive file descriptor ) I dont have access to descriptor of file "dump.txt" the next programm PHP Code:
I write text to file dump2.txt. How is correctly to send/receive file descriptor by shmemory? can I to send socket descriptor by shared memory? Last edited by akalend; 02-08-2010 at 07:30 PM.. |
| Sponsored Links | |
|
|
|
#2
|
|||
|
|||
|
All you've done is copy the integer 3 into some memory. This doesn't magically reopen FD 3 anywhere. how does the other method arrange to have the FD duplicated?
|
| Sponsored Links | ||
|
|
|
#3
|
|||
|
|||
|
Two processes cannot shared a single file descriptor ,
Sending a file descriptor does not mean that you can open and access the file, its just a number for the other process. Otherwise send a file name via shared memory and make the other process to open and get a file descriptor for itself then access the file. |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shared memory for shared library | otheus | Programming | 0 | 09-03-2008 03:55 AM |
| Shared memory in shared library | DreamWarrior | Programming | 12 | 05-30-2007 04:33 PM |
| memory sharing - not shared memory - | elzalem | Programming | 9 | 05-02-2007 07:45 AM |
| all about shared memory | vijaya2006 | Linux | 0 | 02-28-2006 03:14 AM |
| Shared memory shortage but lots of unused memory | cjcamaro | UNIX for Advanced & Expert Users | 1 | 10-13-2004 05:10 PM |
|
|