[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-devtools
Subject:    Re: HPUX-DEVTOOLS: Thread safety of {set,get,end}mntent in
From:       Jerrold Leichter <jerrold.leichter () smarts ! com>
Date:       2003-10-15 14:42:13
[Download RAW message or body]

| Date: Wed, 15 Oct 2003 18:31:11 +0530
| From: Rohit Gupta <rohitg@india.hp.com>
| Subject: Re: HPUX-DEVTOOLS: Thread safety of {set,get,
|     end}mntent in HP-UX 11.0
|
| Yes, what you've stated is indeed correct. All the threads may not
| want to be trying to open the same file and have multiple file stream
| pointers to the same file, and similarly, for closure.
Eh?  There no problem with fopen'ing the same file in multiple threads.

|							 Whereas,
| getmntent may be used by more than one thread, at a time, which is why
| its thread-safe.
|
| Probably, as a workaround, you could try using "setmntent" invoked in
| a function that is registered as "pthread_once()" and so be the case
| with endmntent.
That's not a useful workaround.  This is a program that needs to periodically
determine the current list of mounted file systems.  There is no documented
way to "rewind" the stream that getmntend() "...reads the next line from" -
except to close it with endmntent() and re-open it with setmntent().

| Hope this helps.
I actually opened a support call on this, and learned little.  The man pages
are just about incomprehensible.  (JAGae95373 has been opened on this.)

Meanwhile ... is there anything in these calls that is really not thread
safe?  If so, is there any way to *repeatedly* scan the up-to-date list of
mounted file systems?
							-- Jerry
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE hpux-devtools
 _________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic