Sponsored Content
Top Forums Programming How to use option of Selected SUSv3 options? Post 302729211 by fpmurphy on Friday 9th of November 2012 10:07:20 AM
Old 11-09-2012
Here is what POSIX.1 says:
Code:
If name is an invalid value, sysconf() shall return -1 and set errno to indicate the error. 
If the variable corresponding to name is described in <limits.h> as a maximum or minimum
value and the variable has no limit, sysconf() shall return -1 without changing the value 
of errno. Note that indefinite limits do not imply infinite limits; see <limits.h>.

Otherwise, sysconf() shall return the current variable value on the system. The value 
returned shall not be more restrictive than the corresponding value described to the 
application when it was compiled with the implementation's <limits.h> or <unistd.h>. The 
value shall not change during the lifetime of the calling process, [XSI] [Option Start]  
except that sysconf(_SC_OPEN_MAX) may return different values before and after a call 
to setrlimit() which changes the RLIMIT_NOFILE soft limit. [Option End]

If the variable corresponding to name is dependent on an unsupported option, the results 
are unspecified.

and here is an example:
Code:
#include <stdio.h>
#include <unistd.h>
#include <errno.h>

main() {
  long result;

  errno = 0;
  puts("Checking NGROUPS_MAX limit");
  if ((result = sysconf(_SC_NGROUPS_MAX)) == -1)
    if (errno == 0)
      puts("NGROUPS_MAX is not supported.");
    else perror("sysconf() error");
  else
    printf("The maximum number of supplemental groups (NGROUPS_MAX) is %ld\n", result);
}


Last edited by fpmurphy; 11-09-2012 at 11:12 AM..
This User Gave Thanks to fpmurphy For This Post:
 

8 More Discussions You Might Find Interesting

1. Solaris

how to do selected copy

I need to copy the files from one dir to another dir based on sysdate, like cp -> (sysdate-n) filename -> to -> new dir n = 1,2,3.............. (3 Replies)
Discussion started by: dbasan
3 Replies

2. Solaris

can not mount the selected partition

Dear Brothers First i installed suse linux with the following partition. my hd0 size is 75gb hdc1 swap 1 gb hdc2 native linux 39gb For the rest of the 35 gb i did not create any partition. so i planned to install solaris 10x86 on that free space. When i installed the solaris i... (1 Reply)
Discussion started by: sayed_021
1 Replies

3. Shell Programming and Scripting

option followed by : taking next option if argument missing with getopts

Hi all, I am parsing command line options using getopts. The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument. Below is the script: while getopts :hd:t:s:l:p:f: opt do case "$opt" in -h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies

4. Shell Programming and Scripting

trying to print selected fields of selected lines by AWK

I am trying to print 1st, 2nd, 13th and 14th fields of a file of line numbers from 29 to 10029. I dont know how to put this in one code. Currently I am removing the selected lines by awk 'NR==29,NR==10029' File1 > File2 and then doing awk '{print $1, $2, $13, $14}' File2 > File3 Can... (3 Replies)
Discussion started by: ananyob
3 Replies

5. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

6. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

7. Shell Programming and Scripting

How to print selected fields

HI, I am using below command to display the words, but i am getting awk error. Please help me out on this I am using below code i am getting error as If i use below code i am getting below OP Output from where i am trying to select the fields after delimiter "," from here i want to... (5 Replies)
Discussion started by: darling
5 Replies

8. Solaris

Unrecognized option: sparc-sun-Solaris2.10/bin/as: unrecognized option `-m32'

Hi, I installed some packages required by an app built with python. But when I try python setup.py install, I get the following error: /opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-solaris2.10/bin/as: unrecognized option `-m32' Could anyone tell me what's wrong... (4 Replies)
Discussion started by: Kimkun
4 Replies
POSIX_SPAWNATTR_SETSIGMASK(3)				   BSD Library Functions Manual 			     POSIX_SPAWNATTR_SETSIGMASK(3)

NAME
posix_spawnattr_setsigmask posix_spawnattr_getsigmask -- set or get the spawn-sigmask attribute on a posix_spawnattr_t SYNOPSIS
#include <spawn.h> int posix_spawnattr_setsigmask(posix_spawnattr_t *restrict attr, const sigset_t *restrict sigmask); int posix_spawnattr_getsigmask(const posix_spawnattr_t *restrict attr, sigset_t *restrict sigmask); DESCRIPTION
The posix_spawnattr_setsigmask() function sets the sigmask on the attributes object referenced by attr. The posix_spawnattr_getsigmask() function retrieves the sigmask on the attributes object referenced by attr. The argument sigmask is the initial signal mask to be set for the new process on creation if the POSIX_SPAWN_SETSIGMASK flag is set in the posix_spawnattr_t. It's default value must be set via a call to posix_spawnattr_setflags(3) or the behaviour is undefined. RETURN VALUES
On success, these functions return 0; on failure they return an error number from <errno.h>. Additionally, if successful, posix_spawnattr_getsigmask() will modify the contents of the sigmask parameter with the current attribute value. ERRORS
These functions may fail if: [EINVAL] The value specified by attr is invalid. [EINVAL] The value of attr is invalid. SEE ALSO
posix_spawn(2), posix_spawnp(2), posix_spawnattr_init(3), posix_spawnattr_destroy(3), posix_spawnattr_setflags(3) STANDARDS
Version 3 of the Single UNIX Specification (``SUSv3'') [SPN] HISTORY
The posix_spawnattr_setsigmask() and posix_spawnattr_getsigmask() function calls appeared in Version 3 of the Single UNIX Specification (``SUSv3'') [SPN]. Mac OS X August 22, 2007 Mac OS X
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy