Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.unix.programmer > #15449 > unrolled thread
| Started by | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| First post | 2024-02-12 01:54 +0000 |
| Last post | 2024-02-13 21:17 +0000 |
| Articles | 20 on this page of 29 — 8 participants |
Back to article view | Back to comp.unix.programmer
Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 01:54 +0000
Re: Getting SOMAXCONN Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-12 13:51 +0000
Re: Getting SOMAXCONN gazelle@shell.xmission.com (Kenny McCormack) - 2024-02-12 15:20 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 21:07 +0000
Re: Getting SOMAXCONN "James K. Lowden" <jklowden@speakeasy.net> - 2024-04-08 19:46 +0000
Re: Getting SOMAXCONN gazelle@shell.xmission.com (Kenny McCormack) - 2024-04-08 21:01 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-08 22:27 +0000
Re: Getting SOMAXCONN Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-04-08 15:47 -0700
Re: Getting SOMAXCONN "James K. Lowden" <jklowden@speakeasy.net> - 2024-04-08 23:32 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 20:46 +0000
Re: Getting SOMAXCONN Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-12 20:58 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 21:08 +0000
Re: Getting SOMAXCONN Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-12 21:09 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 21:16 +0000
Re: Getting SOMAXCONN Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-12 21:08 +0000
Re: Getting SOMAXCONN scott@slp53.sl.home (Scott Lurndal) - 2024-02-12 20:59 +0000
Re: Getting SOMAXCONN Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-12 13:51 -0800
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 22:09 +0000
Re: Getting SOMAXCONN Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-12 21:53 +0000
Re: Getting SOMAXCONN Nicolas George <nicolas$george@salle-s.org> - 2024-02-12 16:38 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-12 20:45 +0000
Re: Getting SOMAXCONN Nicolas George <nicolas$george@salle-s.org> - 2024-02-12 22:12 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-13 01:26 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-13 07:48 +0000
Re: Getting SOMAXCONN Nicolas George <nicolas$george@salle-s.org> - 2024-02-13 08:09 +0000
Re: Getting SOMAXCONN scott@slp53.sl.home (Scott Lurndal) - 2024-02-13 15:12 +0000
Re: Getting SOMAXCONN Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-13 15:35 +0000
Re: Getting SOMAXCONN Nicolas George <nicolas$george@salle-s.org> - 2024-02-13 16:12 +0000
Re: Getting SOMAXCONN Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-13 21:17 +0000
Page 1 of 2 [1] 2 Next page →
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-12 01:54 +0000 |
| Subject | Getting SOMAXCONN |
| Message-ID | <uqbtpc$170j7$1@dont-email.me> |
On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
not a static constant, but is a configurable kernel parameter. Here is a
simple Python command to return the value for your currently-running
kernel:
print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))
[toc] | [next] | [standalone]
| From | Lew Pitcher <lew.pitcher@digitalfreehold.ca> |
|---|---|
| Date | 2024-02-12 13:51 +0000 |
| Message-ID | <uqd7oa$1hn3i$1@dont-email.me> |
| In reply to | #15449 |
On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
> not a static constant, but is a configurable kernel parameter. Here is a
> simple Python command to return the value for your currently-running
> kernel:
>
> print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))
Here's the (ba)sh equivalent command:
cat /proc/sys/net/core/somaxconn
--
Lew Pitcher
"In Skills We Trust"
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2024-02-12 15:20 +0000 |
| Message-ID | <uqdd00$17sec$1@news.xmission.com> |
| In reply to | #15450 |
In article <uqd7oa$1hn3i$1@dont-email.me>,
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>
>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
>> not a static constant, but is a configurable kernel parameter. Here is a
>> simple Python command to return the value for your currently-running
>> kernel:
>>
>> print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))
>
>Here's the (ba)sh equivalent command:
>
> cat /proc/sys/net/core/somaxconn
I expect someone will post the COBOL version any minute now.
--
Those on the right constantly remind us that America is not a
democracy; now they claim that Obama is a threat to democracy.
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-12 21:07 +0000 |
| Message-ID | <uqe1b8$1n31c$1@dont-email.me> |
| In reply to | #15451 |
On Mon, 12 Feb 2024 15:20:32 -0000 (UTC), Kenny McCormack wrote: > I expect someone will post the COBOL version any minute now. ... on BSD.
[toc] | [prev] | [next] | [standalone]
| From | "James K. Lowden" <jklowden@speakeasy.net> |
|---|---|
| Date | 2024-04-08 19:46 +0000 |
| Message-ID | <20240407173313.54ea08fab5b020b97755f38c@speakeasy.net> |
| In reply to | #15451 |
On Mon, 12 Feb 2024 15:20:32 -0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) wrote:
> > cat /proc/sys/net/core/somaxconn
>
> I expect someone will post the COBOL version any minute now.
As Polonius said, "Brevity Is the soul of wit".
IDENTIFICATION DIVISION.
PROGRAM-ID. SHOW-SOMAXCONN.
AUTHOR. On behalf of Kenny McCormack.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SOMAXCONN
ASSIGN TO "/proc/sys/net/core/somaxconn"
ORGANIZATION IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD SOMAXCONN.
01 DATUM PIC 9(8).
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
OPEN INPUT SOMAXCONN.
READ DATUM.
DISPLAY "somaxconn is " DATUM.
DIVIDE 1024 into DATUM.
DISPLAY "somaxconn is " DATUM " KB".
$ gcobol -oo read-file.cbl && ./o
somaxconn is 4096
somaxconn is 00000004 KB
gcobol is the ISO COBOL front-end being developed for GCC. The
development platform is Ubuntu, but it has been shown to compile under
Open BSD, too, modulo a few patches.
--jkl
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2024-04-08 21:01 +0000 |
| Message-ID | <uv1lvc$3hqs4$1@news.xmission.com> |
| In reply to | #15745 |
In article <20240407173313.54ea08fab5b020b97755f38c@speakeasy.net>, James K. Lowden <jklowden@speakeasy.net> wrote: >On Mon, 12 Feb 2024 15:20:32 -0000 (UTC) >gazelle@shell.xmission.com (Kenny McCormack) wrote: > >> > cat /proc/sys/net/core/somaxconn >> >> I expect someone will post the COBOL version any minute now. > >As Polonius said, "Brevity Is the soul of wit". > > IDENTIFICATION DIVISION. > PROGRAM-ID. SHOW-SOMAXCONN. > AUTHOR. On behalf of Kenny McCormack. That is so cool! Thanks for posting! -- I shot a man on Fifth Aveneue, just to see him die.
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-04-08 22:27 +0000 |
| Message-ID | <uv1r0b$3oohj$5@dont-email.me> |
| In reply to | #15745 |
On Mon, 08 Apr 2024 19:46:32 +0000, James K. Lowden wrote: > DISPLAY "somaxconn is " DATUM. DIVIDE 1024 into DATUM. > DISPLAY "somaxconn is " DATUM " KB". Just a note that SOMAXCONN is a number of entries (the limit on the accept-pending queue), not a size in bytes. > gcobol is the ISO COBOL front-end being developed for GCC. Is that different from gnucobol?
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Date | 2024-04-08 15:47 -0700 |
| Message-ID | <87sezvfp49.fsf@nosuchdomain.example.com> |
| In reply to | #15750 |
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Mon, 08 Apr 2024 19:46:32 +0000, James K. Lowden wrote:
>
>> DISPLAY "somaxconn is " DATUM. DIVIDE 1024 into DATUM.
>> DISPLAY "somaxconn is " DATUM " KB".
>
> Just a note that SOMAXCONN is a number of entries (the limit on the
> accept-pending queue), not a size in bytes.
>
>> gcobol is the ISO COBOL front-end being developed for GCC.
>
> Is that different from gnucobol?
Yes. GnuCOBOL evolved from OpenCOBOL, and is a translator that
generates C code that's fed to gcc. gcobol (which is newer) is a
frontend for gcc.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */
[toc] | [prev] | [next] | [standalone]
| From | "James K. Lowden" <jklowden@speakeasy.net> |
|---|---|
| Date | 2024-04-08 23:32 +0000 |
| Message-ID | <20240407211844.84f6e0ebbfb2c494cd2d02c9@speakeasy.net> |
| In reply to | #15750 |
On Mon, 8 Apr 2024 22:27:24 -0000 (UTC) Lawrence D'Oliveiro <ldo@nz.invalid> wrote: > On Mon, 08 Apr 2024 19:46:32 +0000, James K. Lowden wrote: > > > DISPLAY "somaxconn is " DATUM. DIVIDE 1024 into DATUM. > > DISPLAY "somaxconn is " DATUM " KB". > > Just a note that SOMAXCONN is a number of entries (the limit on the > accept-pending queue), not a size in bytes. A useful clarification, thanks. I should have known, from the discussion. Or, you know, documentation. :-) The intention was only to show that PIC 9(8) in COBOL is a computable field where the numerical value is held as a sequence of up to 8 characters. > > gcobol is the ISO COBOL front-end being developed for GCC. > > Is that different from gnucobol? Yes. GnuCOBOL is another, much older, project. It converts COBOL to C, and uses a C compiler (usually gcc) to produce executable code. gcobol extends GCC directly and sits alongside the other languages -- C, C++, Java, Fortran, Go, Modula2, Pascal, Rust, et al. -- that gcc compiles. At present, gcobol is maintained in separate repository https://gitlab.cobolworx.com/COBOLworx/gcc-cobol that is updated periodically from the main GCC repository. We are in the process of merging the code upstream, after which point COBOL will become part of the official GCC distribution. --jkl
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-12 20:46 +0000 |
| Message-ID | <uqe02c$1mqnb$4@dont-email.me> |
| In reply to | #15450 |
On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>
>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>> is not a static constant, but is a configurable kernel parameter. Here
>> is a simple Python command to return the value for your
>> currently-running kernel:
>>
>> print(int(open("/proc/sys/net/core/somaxconn",
>> "rt").read().strip()))
>
> Here's the (ba)sh equivalent command:
>
> cat /proc/sys/net/core/somaxconn
Code normally needs it as an integer.
[toc] | [prev] | [next] | [standalone]
| From | Lew Pitcher <lew.pitcher@digitalfreehold.ca> |
|---|---|
| Date | 2024-02-12 20:58 +0000 |
| Message-ID | <uqe0qc$1mdue$1@dont-email.me> |
| In reply to | #15454 |
On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
> On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>
>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>> is not a static constant, but is a configurable kernel parameter. Here
>>> is a simple Python command to return the value for your
>>> currently-running kernel:
>>>
>>> print(int(open("/proc/sys/net/core/somaxconn",
>>> "rt").read().strip()))
>>
>> Here's the (ba)sh equivalent command:
>>
>> cat /proc/sys/net/core/somaxconn
>
> Code normally needs it as an integer.
If you say so...
$(($(cat /proc/sys/net/core/somaxconn) + 1))
I added 1 to somaxconn. It's math, so I must have an integer.
--
Lew Pitcher
"In Skills We Trust"
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-12 21:08 +0000 |
| Message-ID | <uqe1c9$1n31c$2@dont-email.me> |
| In reply to | #15455 |
On Mon, 12 Feb 2024 20:58:53 -0000 (UTC), Lew Pitcher wrote: > On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote: > >> Code normally needs it as an integer. > > If you say so... > > $(($(cat /proc/sys/net/core/somaxconn) + 1)) > > I added 1 to somaxconn. It's math, so I must have an integer. Now use it as one.
[toc] | [prev] | [next] | [standalone]
| From | Lew Pitcher <lew.pitcher@digitalfreehold.ca> |
|---|---|
| Date | 2024-02-12 21:09 +0000 |
| Message-ID | <uqe1eb$1mdue$3@dont-email.me> |
| In reply to | #15458 |
On Mon, 12 Feb 2024 21:08:26 +0000, Lawrence D'Oliveiro wrote: > On Mon, 12 Feb 2024 20:58:53 -0000 (UTC), Lew Pitcher wrote: > >> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote: >> >>> Code normally needs it as an integer. >> >> If you say so... >> >> $(($(cat /proc/sys/net/core/somaxconn) + 1)) >> >> I added 1 to somaxconn. It's math, so I must have an integer. > > Now use it as one. OK echo SOMAXCONN plus 1 equals $(($(cat /proc/sys/net/core/somaxconn) + 1)) -- Lew Pitcher "In Skills We Trust"
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-12 21:16 +0000 |
| Message-ID | <uqe1ro$1n31c$6@dont-email.me> |
| In reply to | #15460 |
On Mon, 12 Feb 2024 21:09:31 -0000 (UTC), Lew Pitcher wrote:
> On Mon, 12 Feb 2024 21:08:26 +0000, Lawrence D'Oliveiro wrote:
>
>> On Mon, 12 Feb 2024 20:58:53 -0000 (UTC), Lew Pitcher wrote:
>>
>>> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
>>>
>>>> Code normally needs it as an integer.
>>>
>>> If you say so...
>>>
>>> $(($(cat /proc/sys/net/core/somaxconn) + 1))
>>>
>>> I added 1 to somaxconn. It's math, so I must have an integer.
>>
>> Now use it as one.
>
> OK
> echo SOMAXCONN plus 1 equals $(($(cat /proc/sys/net/core/somaxconn) +
> 1))
As in:
SOMAXCONN = None # to begin with
def get_SOMAXCONN() :
"returns the Linux kernel-configured value of SOMAXCONN."
global SOMAXCONN
if SOMAXCONN == None :
SOMAXCONN = int(open("/proc/sys/net/core/somaxconn", "rt").read().strip())
#end if
return \
SOMAXCONN
#end get_SOMAXCONN
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.listen(get_SOMAXCONN())
[toc] | [prev] | [next] | [standalone]
| From | Lew Pitcher <lew.pitcher@digitalfreehold.ca> |
|---|---|
| Date | 2024-02-12 21:08 +0000 |
| Message-ID | <uqe1cl$1mdue$2@dont-email.me> |
| In reply to | #15455 |
On Mon, 12 Feb 2024 20:58:53 +0000, Lew Pitcher wrote:
> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
>
>> On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>>
>>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>>
>>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>>> is not a static constant, but is a configurable kernel parameter. Here
>>>> is a simple Python command to return the value for your
>>>> currently-running kernel:
>>>>
>>>> print(int(open("/proc/sys/net/core/somaxconn",
>>>> "rt").read().strip()))
>>>
>>> Here's the (ba)sh equivalent command:
>>>
>>> cat /proc/sys/net/core/somaxconn
>>
>> Code normally needs it as an integer.
>
> If you say so...
>
> $(($(cat /proc/sys/net/core/somaxconn) + 1))
>
> I added 1 to somaxconn. It's math, so I must have an integer.
Here's the thing. Without context, neither Lawrence's solution
nor mine are worth anything.
We note that, in Linux, SOMAXCONN is variable, and we can read
a string equivalent of it's value from file /proc/sys/net/core/somaxconn
Someone posts a "simple python command" to do so, and someone else posts
a bash/sh command to do the same.
But, the OP's unstated context was that the integer value of SOMAXCONN
might be needed in a program /as an integer value/ (and not a string).
The posted code was seemingly intended to show an example of a program
that derived the integer value of SOMAXCONN from the string stored in
the /proc/sys/net/core/somaxconn file.
And the counter-example showed the same thing.
But, in the end, neither example is relevant. For example, neither
example code fragment will be of use in a C (or COBOL) program.
And, so ends my facetious banter about SOMAXCONN. You may now
resume your regularly scheduled programming.
--
Lew Pitcher
"In Skills We Trust"
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2024-02-12 20:59 +0000 |
| Message-ID | <IEvyN.142336$taff.26273@fx41.iad> |
| In reply to | #15454 |
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>
>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>> is not a static constant, but is a configurable kernel parameter. Here
>>> is a simple Python command to return the value for your
>>> currently-running kernel:
>>>
>>> print(int(open("/proc/sys/net/core/somaxconn",
>>> "rt").read().strip()))
>>
>> Here's the (ba)sh equivalent command:
>>
>> cat /proc/sys/net/core/somaxconn
>
>Code normally needs it as an integer.
$ application -m $(cat /proc/sys/net/core/somaxconn)
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Date | 2024-02-12 13:51 -0800 |
| Message-ID | <87jzn98i71.fsf@nosuchdomain.example.com> |
| In reply to | #15456 |
scott@slp53.sl.home (Scott Lurndal) writes:
[...]
> $ application -m $(cat /proc/sys/net/core/somaxconn)
$ application -m $(</proc/sys/net/core/somaxconn)
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-12 22:09 +0000 |
| Message-ID | <uqe4v1$1nl53$5@dont-email.me> |
| In reply to | #15462 |
On Mon, 12 Feb 2024 13:51:30 -0800, Keith Thompson wrote: > scott@slp53.sl.home (Scott Lurndal) writes: [...] > >> $ application -m $(cat /proc/sys/net/core/somaxconn) > > $ application -m $(</proc/sys/net/core/somaxconn) Hah! Somebody found a UUOC!
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <433-929-6894@kylheku.com> |
|---|---|
| Date | 2024-02-12 21:53 +0000 |
| Message-ID | <20240212135111.403@kylheku.com> |
| In reply to | #15454 |
On 2024-02-12, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>
>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>> is not a static constant, but is a configurable kernel parameter. Here
>>> is a simple Python command to return the value for your
>>> currently-running kernel:
>>>
>>> print(int(open("/proc/sys/net/core/somaxconn",
>>> "rt").read().strip()))
>>
>> Here's the (ba)sh equivalent command:
>>
>> cat /proc/sys/net/core/somaxconn
>
> Code normally needs it as an integer.
This is the TXR Lisp interactive listener of TXR 293.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
TXR is light and portable; take it camping, or to the Bahamas.
1> (file-get "/proc/sys/net/core/somaxconn")
128
2> (typeof (file-get "/proc/sys/net/core/somaxconn"))
fixnum
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
[toc] | [prev] | [next] | [standalone]
| From | Nicolas George <nicolas$george@salle-s.org> |
|---|---|
| Date | 2024-02-12 16:38 +0000 |
| Message-ID | <65ca4988$0$3003$426a34cc@news.free.fr> |
| In reply to | #15449 |
Lawrence D'Oliveiro , dans le message <uqbtpc$170j7$1@dont-email.me>, a
écrit :
> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
> not a static constant, but is a configurable kernel parameter. Here is a
> simple Python command to return the value for your currently-running
> kernel:
>
> print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))
Why do you think you need it in a program?
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.unix.programmer
csiph-web