Skip to content

Conversation

matyhtf
Copy link
Contributor

@matyhtf matyhtf commented Aug 21, 2013

pcntl_daemonize: run as a daemon.
pcntl_setaffinity: set cpu binding.

@@ -44,6 +44,13 @@
#include <sys/resource.h>
#endif

#ifdef HAVE_SCHED_SETAFFINITY
#ifndef __USE_GNU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read __USE_GNU shouldn't be used directly: http://stackoverflow.com/questions/7296963/gnu-source-and-use-gnu
Is it right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you want to use GNU extensions, you'd probably want to define _GNU_SOURCE before including the header (just as outlined in the man page of sched_setaffinity).

@smalyshev
Copy link
Contributor

Note that both of your tests fail on Travis.

@m6w6
Copy link
Contributor

m6w6 commented Sep 16, 2013

For both functions I'd opt for a name more akin to the original names:

pcntl_daemon()
and
pcntl_sched_setaffinity()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants