IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

sched_getaffinity (2)

SCHED_SETAFFINITY(2)       Linux Programmer's Manual      SCHED_SETAFFINITY(2)



NAME
       sched_setaffinity,  sched_getaffinity  -  set  and  get a process's CPU
       affinity mask

SYNOPSIS
       #include<sched.h>

       intsched_setaffinity(pid_t  pid,unsignedint  len,unsignedlong
       *mask);

       intsched_getaffinity(pid_t  pid,unsignedint  len,unsignedlong
       *mask);


DESCRIPTION
       sched_setaffinity sets the CPU affinity mask of the process denoted  by
       pid.  If pid is zero, then the current process is used.

       The  affinity  mask  is represented by the bitmask stored in mask.  The
       least significant bit corresponds to the first logical processor number
       on  the  system, while the most significant bit corresponds to the last
       logical processor number on the system.  A set  bit  corresponds  to  a
       legally  schedulable CPU while an unset bit corresponds to an illegally
       schedulable CPU.  In other words, a process is bound to and  will  only
       run on processors whose corresponding bit is set.  Usually, all bits in
       the mask are set.

       The argument len is the length of the data pointed to  by  mask.   Nor-
       mally this is the size of a word on the system.  For compatibility with
       future versions of the Linux kernel, since this size  can  change,  the
       bitmask  supplied must be at least as large as the affinity mask stored
       in the kernel.

       The function sched_getaffinity writes into the pointer supplied by mask
       that  is  size  len  the affinity mask of process pid.  If pid is zero,
       then the mask of the current process is returned.


RETURNVALUE
       On success, sched_setaffinity and sched_getaffinity both return 0.   On
       error, -1 is returned, and errno is set appropriately.


ERRORS
       EFAULT A supplied memory address was invalid.

       ESRCH  The process whose ID is pid could not be found.

       EPERM  The  calling  process  does not have appropriate privileges. The
              process calling sched_setaffinity needs an effective  uid  equal
              to  the  euid  or  uid  of  the process identified by pid, or it
              posses the CAP_SYS_NICE capability.

       EINVAL The affinity bitmask mask contains no processors that are physi-
              cally  on  the system or the length len is smaller than the size
              of the affinity mask used by the kernel.

HISTORY
       The affinity syscalls were introduced in Linux kernel 2.5.8.


SEEALSO
       sched_setscheduler(2),     sched_getscheduler(2),      sched_get_prior-
       ity_max(2),    sched_get_priority_min(2),    nice(2),   setpriority(2),
       getpriority(2),

       sched_setscheduler(2) has a description of the Linux scheduling scheme.



Linux                             2002-11-19              SCHED_SETAFFINITY(2)

_Exitgetsockoptoutwshmat
_exitgettidoutw_pshmctl
_llseekgettimeofdaypauseshmdt
_newselectgetuidpersonalityshmget
_sysctlgttypipeshmop
acceptidlepivot_rootshutdown
accessinbpollsigaction
acctinb_pprctlsigaltstack
adjtimexinlpreadsigblock
afs_syscallinl_pprofsiggetmask
alarminsbpselectsigmask
alloc_hugepagesinslptracesignal
arch_prctlinswpwritesigpause
bdflushintroquotactlsigpending
bindinwreadsigprocmask
breakinw_preaddirsigqueue
brkioctlreadlinksigreturn
cacheflushioctl_listreadvsigsetmask
capgetiopermrebootsigsuspend
capsetioplrecvsigtimedwait
chdiripcrecvfromsigvec
chmodkillrecvmsgsigwaitinfo
chownkillpgrenamesocket
chrootlchownrmdirsocketcall
clonelinksbrksocketpair
closelistensched_get_priority_maxssetmask
connectllseeksched_get_priority_minstat
creatlocksched_getaffinitystatfs
duplseeksched_getparamstime
dup2lstatsched_getschedulerstty
execvemadvisesched_rr_get_intervalswapoff
exitmincoresched_setaffinityswapon
fchdirmkdirsched_setparamsymlink
fchmodmknodsched_setschedulersync
fchownmlocksched_yieldsyscall
fcntlmlockallselectsyscalls
fdatasyncmmapselect_tutsysctl
flockmmap2semctlsysfs
forkmodify_ldtsemgetsysinfo
free_hugepagesmountsemopsyslog
fstatmprotectsendtime
fstatfsmpxsendfiletimes
fsyncmremapsendmsgtkill
ftruncatemsgctlsendtotruncate
futexmsggetsetcontextumask
getcontextmsgopsetdomainnameumount
getdentsmsgrcvsetegidumount2
getdomainnamemsgsndseteuiduname
getdtablesizemsyncsetfsgidundocumented
getegidmunlocksetfsuidunimplemented
geteuidmunlockallsetgidunlink
getgidmunmapsetgroupsuselib
getgroupsnanosleepsethostidustat
gethostidnfsservctlsethostnameutime
gethostnamenicesetitimerutimes
getitimerobsoletesetpgidvfork
getpagesizeoldfstatsetpgrpvhangup
getpeernameoldlstatsetpriorityvm86
getpgidoldoldunamesetregidwait
getpgrpoldstatsetresgidwait3
getpidoldunamesetresuidwait4
getppidopensetreuidwaitpid
getpriorityoutbsetrlimitwrite
getresgidoutb_psetsidwritev
getresuidoutlsetsockopt 
getrlimitoutl_psettimeofday 
getrusageoutsbsetuid 
getsidoutslsetup 


My Money 2.0.49
Personal financial software
Linux Kernel 2.6 2.6.32-rc8
Linux Kernel
GCstar 1.5.0
Personal collections manager
ImageMagick 6.5.7.9
ImageMagick image processing studio
BibleTime 2.4
Bible study software for Linux / KDE
PHP 5.3.1
Server-side, cross-platform, HTML embedded scripting language.
LFTP 4.0.4
Shell-like command line ftp client.
GNOME 2.29.2
GNOME desktop environment
Midgard 9.09.0
Web application development and publishing platform
Totem 2.28.4
Movie player for Gnome
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info