Re: Trying to join an already exited pthread



On Fri, 9 Feb 2007 youshi10@xxxxxxxxxxxxxxxx wrote:

On Fri, 9 Feb 2007, Daniel Eischen wrote:

On Thu, 8 Feb 2007, Garrett Cooper wrote:

Actually, now that I think about it the calls I made with ps in the program are valid for Linux but not for FreeBSD (they're for getting thread listings). Hence error code 2.

From intro(2):

2 ENOENT No such file or directory. A component of a specified pathname did not exist, or
the pathname was an empty
string.

Didn't think that a bad command would return errno=2 though..

And hopefully you've realized that your code is totally bogus
since pthread_foo() don't set errno. All the pthread_foo()
functions _return_ the error. If your code is not checking
the return values from those functions, it is wrong on every
platform, not just FreeBSD.

--
DE

Well, right. I was just being lazy by checking errno, instead of checking the return value of pthread_*. It wasn't meant to be anything more than a simple set of tests. I thought that errno was set on errors though, but after reading the manpage more carefully it turns out that this is not the case.

I'll see if I can fix my checks.

Thanks for bringing this to my attention!

-Garrett

Damn habit of always typing in freebsd-questions when using webmail ~_~..

-Garrett


_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Trying to join an already exited pthread
    ... are valid for Linux but not for FreeBSD. ... Hence error code 2. ... ENOENT No such file or directory. ... A component of a specified pathname did not exist, ...
    (freebsd-hackers)
  • Re: Trying to join an already exited pthread
    ... are valid for Linux but not for FreeBSD. ... Hence error code 2. ... ENOENT No such file or directory. ... A component of a specified pathname did not exist, ...
    (freebsd-questions)
  • Re: Trying to join an already exited pthread
    ... are valid for Linux but not for FreeBSD. ... Hence error code 2. ... ENOENT No such file or directory. ... A component of a specified pathname did not exist, ...
    (freebsd-hackers)
  • Re: advanced programming unix environment
    ... I would appreciate if somebody else running freebsd 7.0 could download source and see if it makes fine on their installation. ... *** Error code 1 ... be unable to log in as root in any way, ... After the initial install I was able to log ...
    (freebsd-questions)
  • make buildworld error on FreeBSD 8.0-CURRENT
    ... Recently i am running a FreeBSD 8.0-CURRENT(upgraded from FreeBSD ... *** Error code 2 ... <ACPI PCI bus> on pcib0 ... 2 ports with 2 removable, ...
    (freebsd-current)