Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Where is the fsync_fd() function defined?

by nagalenoj (Friar)
on Apr 27, 2010 at 11:57 UTC ( #837084=perlquestion: print w/ replies, xml ) Need Help??
nagalenoj has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I've downloaded File::Sync from CPAN. I found the below line of code in Sync.pm and I don't understand, how this function is working

# Interface from Perl filehandle to POSIX file descriptor. sub fsync(*) { @_ == 1 or croak "usage: fsync FILEHANDLE"; fsync_fd(fileno(qualify_to_ref($_[0], caller()))); } # Make fsync a method of IO::Handle and FileHandle. *IO::Handle::fsync = *FileHandle::fsync = \&fsync;

I don't know where the fsync_fd function is defined? Can someone clarify me.

Comment on Where is the fsync_fd() function defined?
Download Code
Re: Where is the fsync_fd() function defined?
by marto (Bishop) on Apr 27, 2010 at 12:02 UTC

    The docs state:

    "The fsync_fd() function is used internally by fsync(); it takes a file descriptor as its only argument."

    If you'd like to look at fsync_fd() see Sync.xs.

    Update: Fixed typo: s/fsync_df/fsync_fd/ Thanks kennethk for pointing this out.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://837084]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-07-05 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls