Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: $! or &Errno or $!{}

by jlawrenc (Scribe)
on Mar 21, 2001 at 01:49 UTC ( #65834=note: print w/replies, xml ) Need Help??


in reply to $! or &Errno or $!{}

I was confused by this as well. My cause to delve into IO::Socket was a breakdown of my LWP modules.

Go to your Perl source can check out:

the directory ext/Errno

This is where these strings are actually obtained and made into the Errno.pm module which in turn gives rise to %!.

What is going on here is that at make time Errno_pm.PL actually checks the cpp output to get a list of headers to scan. This output comes from something along the lines of "cpp your cpp flags errno.c". "errno.c" has a single line "#include <errno.h> Then it will scan all of these header files for #defines. (check out /usr/lib/errno.h or /usr/lib/asm/errno.h if you have it). Taking these defines, it will write the code for "Errno.pm" which ultimately lives in "lib/perl5/5.6.0/<arch>/Errno.pm.

The values for %! are supplied via a tied hash from Errno.pm.

Why do I know this? Well because shipped with RedHat did not correctly report all of the headers to scan. When the IO::Socket went to test against $!{EINPROGRESS} it did not match. It was always giving me "Timeout" messages. :( After tracing this through I found the defective output from cpp and the rest is history.

You need the updated cpp that RedHat supplies. This version (dated Dec 18, 2000) works correctly.

J

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://65834]
help
Chatterbox?
[tye]: I don't know if you can just dismount, but I thought so.
[davido]: yeah, umount -f isn't powerful enough.
[tye]: probably something in the init subsystem that does the mounting that you could disable and reboot.
davido needs to close laptop to board flight home from yapc.
[davido]: I'll look into it in a few hours probably.
[davido]: when i do get to that point I think I'll do it in a vm snapshot just in case. :)
[oiskuu]: tye, you were right: loginuid/sessionid are part of task struct if compiled with AUDITSYSCALL. I have some doubts if you should actually depend on that feature.
[Corion]: oiskuu: Depends on what you want to do with that information
[tye]: I'm not depending on that feature. But I could in this environment. I'm using getlogin(). shrug
[Corion]: For benign logging (which user started this DB instance), it's OK

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-06-23 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (555 votes). Check out past polls.