Sponsored Content
Top Forums Programming How to use option of Selected SUSv3 options? Post 302729057 by fwrlfo on Friday 9th of November 2012 02:45:56 AM
Old 11-09-2012
I think you got me wrong................. Ill give you what I wrote you tell me true or false

The Linux Programming Interface: A Linux and Unix System Programming Handbook - Michael Kerrisk - Google Books
page 221

I wrote:
Code:
sysconfPrint("_SC_SEMAPHORES", _SC_SEMAPHORES);

Code:
sysconfPrint(const char *msg, int name)
{
    long lim;

    errno = 0;
    lim = sysconf(name);
    if (lim != -1) {        /* Call succeeded, limit determinate */
        printf("%s %ld\n", msg, lim);
    } else {
        if (errno == 0)     /* Call succeeded, limit indeterminate */
            printf("%s (indeterminate)\n", msg);
        else                /* Call failed */
            errExit("sysconf %s", msg);
    }
}

 

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
COMPAT(5)						      BSD File Formats Manual							 COMPAT(5)

NAME
compat -- manipulate compatibility settings SYNOPSIS
COMMAND_MODE=legacy|unix2003 #define _POSIX_C_SOURCE #define _DARWIN_C_SOURCE #define _NONSTD_SOURCE defined(__LP64__) #include <sys/cdefs.h> defined(_DARWIN_FEATURE_UNIX_CONFORMANCE) DESCRIPTION
Setting the environment variable COMMAND_MODE to the value legacy causes utility programs to behave as closely to Mac OS X 10.3's utility programs as possible. When in this mode all of 10.3's flags are accepted, and in some cases extra flags are accepted, but no flags that were used in 10.3 will have been removed or changed in meaning. Any behavioral changes in this mode are documented in the LEGACY sections of the individual utilities. Setting the environment variable COMMAND_MODE to the value unix2003 causes utility programs to obey the Version 3 of the Single UNIX Specification (``SUSv3'') standards even if doing so would alter the behavior of flags used in 10.3. The value of COMMAND_MODE is case insensitive and if it is unset or set to something other than legacy or unix2003 it behaves as if it were set to unix2003. COMPILATION
Defining _NONSTD_SOURCE for i386 causes library and kernel calls to behave as closely to Mac OS X 10.3's library and kernel calls as possi- ble. Any behavioral changes are documented in the LEGACY sections of the man pages for the individual function calls. Defining this macro when compiling for any other architecture will result in a compilation error. Defining _POSIX_C_SOURCE or _DARWIN_C_SOURCE causes library and kernel calls to conform to the SUSv3 standards even if doing so would alter the behavior of functions used in 10.3. Defining _POSIX_C_SOURCE also removes functions, types, and other interfaces that are not part of SUSv3 from the normal C namespace, unless _DARWIN_C_SOURCE is also defined (i.e., _DARWIN_C_SOURCE is _POSIX_C_SOURCE with non-POSIX exten- sions). In any of these cases, the _DARWIN_FEATURE_UNIX_CONFORMANCE feature macro will be defined to the SUS conformance level (it is unde- fined otherwise). Starting in Mac OS X 10.5, if none of the macros _NONSTD_SOURCE, _POSIX_C_SOURCE or _DARWIN_C_SOURCE are defined, and the environment vari- able MACOSX_DEPLOYMENT_TARGET is either undefined or set to 10.5 or greater (or equivalently, the gcc(1) option -mmacosx-version-min is either not specified or set to 10.5 or greater), then UNIX conformance will be on by default, and non-POSIX extensions will also be available (this is the equivalent of defining _DARWIN_C_SOURCE). For version values less that 10.5, UNIX conformance will be off when targeting i386 (the equivalent of defining _NONSTD_SOURCE). In order to provide both legacy and conformance versions of functions, two versions of affected functions are provided. Legacy variants have symbol names with no suffix in order to maintain ABI compatibility. Conformance versions have a $UNIX2003 suffix appended to their symbol name. These $UNIX2003 suffixes are automatically appended by the compiler tool-chain and should not be used directly. Platforms that were released after these updates only have conformance variants available and do not have a $UNIX2003 suffix. i386 ------------------------------+-------------------------------------------- user defines deployment | namespace conformance suffix target | ------------------------------+-------------------------------------------- (none) < 10.5 | full 10.3 compatibility (none) (none) >= 10.5 | full SUSv3 conformance $UNIX2003 _NONSTD_SOURCE (any) | full 10.3 compatibility (none) _DARWIN_C_SOURCE < 10.4 | full 10.3 compatibility (none) _DARWIN_C_SOURCE >= 10.4 | full SUSv3 conformance $UNIX2003 _POSIX_C_SOURCE < 10.4 | strict 10.3 compatibility (none) _POSIX_C_SOURCE >= 10.4 | strict SUSv3 conformance $UNIX2003 ------------------------------+-------------------------------------------- Newer Architectures ------------------------------+-------------------------------------------- user defines deployment | namespace conformance suffix target | ------------------------------+-------------------------------------------- (none) (any) | full SUSv3 conformance (none) _NONSTD_SOURCE (any) | (error) _DARWIN_C_SOURCE (any) | full SUSv3 conformance (none) _POSIX_C_SOURCE (any) | strict SUSv3 conformance (none) ------------------------------+-------------------------------------------- STANDARDS
With COMMAND_MODE set to anything other than legacy, utility functions conform to Version 3 of the Single UNIX Specification (``SUSv3''). With _POSIX_C_SOURCE or _DARWIN_C_SOURCE for i386, or when building for any other architecture, system and library calls conform to Version 3 of the Single UNIX Specification (``SUSv3''). BUGS
Different parts of a program can be compiled with different compatibility settings. The resultant program will normally work as expected, for example a regex created by the SUSv3 regcomp(3) can be passed to the legacy regfree(3) with no unexpected results. Some cases are less clear cut, for example what does the programmer intend when they use the SUSv3 regcomp(3) to compile a regex, but the legacy regexec(3) to execute it? Any interpretation will surprise someone. Darwin June 30, 2010 Darwin
All times are GMT -4. The time now is 10:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy