Change value for POSIX

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Change value for POSIX
# 1  
Old 08-30-2017
Change value for POSIX


I have a VM with following configration .

3.10.0-693.1.1.el7.x86_64 #1 SMP Thu Aug 3 08:15:31 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

My current POSIX is :--

Your environment variables take up 2011 bytes
POSIX upper limit on argument length (this system): 2093093
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2091082
Size of command buffer we are actually using: 131072

I want to change the value for POSIX smallest allowable upper limit on argument length (all systems): 4096 to 1 MB.

How do we get this changed ?

# 2  
Old 08-30-2017
Why do you want to change this reasonable limit?

Last edited by MadeInGermany; 08-30-2017 at 01:43 PM..
# 3  
Old 08-30-2017
You come up with a convincing argument explaining why no system conforming to the standard should be allowed to have an ARG_MAX limit less than 1048576, you come up with a convincing argument explaining why small memory model applications should not be allowed to run on standards-conforming systems on hardware using x86 compatible CPU architectures, you come up with convincing arguments why any other systems and features affected by your changes on those systems that currently conform to the standards should not be allowed to still be considered standard-conforming when a revision of the standard is approved that includes your desired changes, and then you file a change request for the standard at the POSIX Standards bug reporting site asking for the _POSIX_ARG_MAX limit in <limits.h> in the Base Definitions and Headers category to be changed whatever limit you think you can get the member companies of the Open Group's Base Working Group who will vote on the next revision of the Single UNIX Specification, the member countries of ISO who will vote on the next revision of ISO 9945 Standard, AND the individual members of the IEEE Standards Association who will vote on the next revision of the IEEE 1003.1 Standard will all approve.

The next revision of these three linked standards is expected to be approved sometime around 2020 or 2021. Then you will need to wait for companies who build operating systems to release updates that conform to the new standard and you will need to use one of those conforming products. Other operating systems might or might not increase the _POSIX_ARG_MAX limit even though they do not conform to other requirements of that standard. (Note that no Linux distribution has yet claimed to conform to any version of the POSIX standards.)
# 4  
Old 08-31-2017
Actually I have 500K arguments to passed . The rough length of each argument is roughly 23 characters . so best i can pass is roughly 175 arguments and each loop . This is making the execution very slow as I was planning to pass roughly 2K per loop. Hence, wanted to bypass the POSIX limit .
# 5  
Old 08-31-2017
You have not given any reason why _POSIX_ARG_MAX should be changed in the standards. Why are you trying to restrict your code to the smallest argument list size guaranteed to be available on every system instead of using the resources that your system tells you are available on your system? There is no reason to restrict yourself to the value of _POSIX_ARG_MAX in <limits.h>. Just restrict yourself to the value of ARG_MAX in <limits.h> on your system (which you have shown us is 2093093 bytes, approximately 2Mb - 4Kb). Or, assuming that there aren't huge variations in the size of each argument, just use 250k arguments on 2 invocations instead of 175 arguments on a little under 3000 invocations.

Or, if you're using shell instead of C to invoke commands with varying numbers of arguments based on the limits of your system, find ... -exec utility initial_arg... {} + and xargs are perfectly capable of performing these calculations without your script needing to care about the limits.
# 6  
Old 08-31-2017
Hi, The reason why I am posting it under POSIX smallest allowable upper limit on argument length (all systems): 4096 is because , I am trying to run a mongo query from shell. When I run the query directly on Mongo it works fine but when I run it from shell script it is taking max of 4096 characters only in argument list . So, I am forced to sent it in batches of 175 . I checked with Mongo team and they confirmed it is POSIX limitations of shell which is causing it and nothing to do with Mongo
# 7  
Old 08-31-2017
What shell are you using? If you were using a POSIX-conforming shell (such as ksh or bash), you would not be limited to an argument list maximum of _POSIX_ARG_MAX on a system where ARG_MAX is about 500 times larger.

How are you constructing the argument list to be passed to Mongo? What are the arguments to Mongo? Please show us the shell script you are using to gather arguments and invoke Mongo.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

POSIX compliance...

Thanks to all you guys about posix compliance I have learnt an enormous amount over the last few days. I have written a program that is an Egg Timer with simple animation. I now realise how sophisticated 'bash' is compared to full posix compliance. The code below has passed all of the tests from... (11 Replies)
Discussion started by: wisecracker
11 Replies

2. Programming

POSIX Thread Help

I want to create a program that creates 2 child process, and each of them creates 2 threads, and each thread prints its thread id. I0ve allread done that the outuput isn't the outuput i want. When a run the following comand "$./a.out | sort -u | wc -l" I have the folowing output 2 $: It should... (3 Replies)
Discussion started by: pharaoh
3 Replies

3. UNIX for Advanced & Expert Users

System V or POSIX

Hi , I am using UNIX network programming Vol1 (by R Stevens) book to learn about IPC. I would be using HP-UX,Solaris and Linux at my work. I have sections for POSIX and for System V in that book. I am quite confused in indentifying those OSs as POSIX or SYstem V. Can anyone please... (1 Reply)
Discussion started by: kumaran_5555
1 Replies

4. UNIX for Advanced & Expert Users

Posix threads

Hi, consider the code below: #include <stdio.h> . . struct myStruct { char *message ; int id; }; . . . void *thread_function( void *ptr ); nt main() { pthread_t thread1, thread2 ,thread3 ; struct myStruct nico1; (2 Replies)
Discussion started by: Behnaz
2 Replies

5. Programming


HI, When i am configuring php in SUN Solaris. I am getting the below error. configure: error: Your system seems to lack POSIX threads. Do i need to install POSIX? If so can somebody let me know where can i download POSIX for Solaris 8? Thanks, (2 Replies)
Discussion started by: Krrishv
2 Replies

6. Programming

POSIX threads

Hello ! Let's supose I have a main function in C , and two POSIX threads. I give you an example down : int main() { int something; char else; void *FirstThread(); void *SecondThread(); .. <start those two pthreads ..> return 0;} void *FirstThread() { ... } void *SecondThread()... (2 Replies)
Discussion started by: !_30
2 Replies

7. UNIX for Dummies Questions & Answers

how to read POSIX?

how to read POSIX? poe six or not? (3 Replies)
Discussion started by: robin.zhu
3 Replies

8. Programming


Please,does anybody can give me any general info about unix(posix) ? (1 Reply)
Discussion started by: Haris Astreos
1 Replies

9. Programming


can somebody explain about the ANSI C vs POSIX. say i was using open and fopen, i know that open is POSIX, and fopen is ANSI C. i read that that POSIX is a system call and ANSI C is like a standard library function. wouldn't the fopen function has to call on open function anyway to open any kind... (2 Replies)
Discussion started by: bb00y
2 Replies

10. UNIX for Dummies Questions & Answers

Posix and linux

What is posix? What is the relation between Posix, Unix and linux? (1 Reply)
Discussion started by: darbarilal
1 Replies
Login or Register to Ask a Question

Featured Tech Videos