Aggiornamento note copyright master
authorSimone Piccardi <piccardi@gnulinux.it>
Wed, 10 Jan 2024 11:18:24 +0000 (12:18 +0100)
committerSimone Piccardi <piccardi@gnulinux.it>
Wed, 10 Jan 2024 11:18:24 +0000 (12:18 +0100)
29 files changed:
build.tex
domandemanpages.txt
errors.tex
fileadv.tex
filedir.tex
fileio.tex
gapil.tex
intro.tex
ipc.tex
macro.tex
netlayer.tex
network.tex
othersock.tex
preambolo.tex
pref.tex
procadv.tex
process.tex
prochand.tex
ringraziamenti.tex
session.tex
signal.tex
sockadv.tex
sockctrl.tex
socket.tex
sources/sigwait.c [new file with mode: 0644]
system.tex
tcpsock.tex
thread.tex
trasplayer.tex

index cec0b2db85a160121f3e283e6dceb636fba256d1..ad1ba8fbb0cb0755681ce2e0c678e07f03c8ac01 100644 (file)
--- a/build.tex
+++ b/build.tex
@@ -1,6 +1,6 @@
 %% build.tex
 %%
 %% build.tex
 %%
-%% Copyright (C) 1999-2019 Simone Piccardi.  Permission is granted to copy,
+%% Copyright (C) 1999-2024 Simone Piccardi.  Permission is granted to copy,
 %% distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index a06a041f982ff8732232914433c664a92fb2167b..1d2bba85abe679380694c98592b5cff8aa833baf 100644 (file)
@@ -6,3 +6,9 @@ Con readv/writev che fine ha fatto EOPNOTSUPP?
 tee ed il supporto per i socket ?
 
 openat e il supposto problema della race condition.
 tee ed il supporto per i socket ?
 
 openat e il supposto problema della race condition.
+
+
+Con sigwait si dice che viene restituito un valore positivo in caso di errore
+ma si elenca soltanto EINVAL, ma se si usa un puntatore non valido, che
+succede? Prima era elencato anche EFAULT, ora no. Dal codice sembrerebbe 
+
index b8b6a8fe264c779d153d257b6eca1367ea817d00..18d618c9bdb433be936efa1354c31ec0297f7a0f 100644 (file)
@@ -1,6 +1,6 @@
 %% errors.tex
 %%
 %% errors.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 948f7210a2f2eca265fbf11f21a32749b384ab6a..1bce388813321f2c7bc72723a9ed5da5eb77ffc9 100644 (file)
@@ -1,6 +1,6 @@
 %% fileadv.tex
 %%
 %% fileadv.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -925,6 +925,7 @@ attuale delle cose è sconsigliabile fare affidamento sul \textit{mandatory
 
 % TODO il supporto è stato reso opzionale nel 4.5, verrà eliminato nel futuro
 % (vedi http://lwn.net/Articles/667210/)
 
 % TODO il supporto è stato reso opzionale nel 4.5, verrà eliminato nel futuro
 % (vedi http://lwn.net/Articles/667210/)
+% è stato eliminato nel 5.15
 
 \itindend{file~locking}
 
 
 \itindend{file~locking}
 
@@ -3498,6 +3499,10 @@ raggruppati in un solo evento.
 % http://lwn.net/Articles/343346/ (incluso nel 2.6.36)
 % fanotify_mark() ha FAN_MARK_FILESYSTEM dal 4.20
 % fanotify() ha FAN_OPEN_EXEC dal 4.21/5.0
 % http://lwn.net/Articles/343346/ (incluso nel 2.6.36)
 % fanotify_mark() ha FAN_MARK_FILESYSTEM dal 4.20
 % fanotify() ha FAN_OPEN_EXEC dal 4.21/5.0
+% fanotify() ha FAN_REPORT_PIDFD dal 5.14
+% fanotify() ha FAN_FS_ERROR dal 5.16, vedi
+% https://docs.kernel.org/admin-guide/filesystem-monitoring.html 
+% fanotify() ha FAN_RENAME dal 5.17, vedi https://kernelnewbies.org/Linux_5.17
 
 
 \subsection{L'interfaccia POSIX per l'I/O asincrono}
 
 
 \subsection{L'interfaccia POSIX per l'I/O asincrono}
@@ -4733,7 +4738,9 @@ caching dei dati.
 % https://lwn.net/Articles/733256/).
 % TODO aggiunte MADV_COLD e MADV_PAGEOUT dal kernel 5.4, vedi
 % https://git.kernel.org/linus/9c276cc65a58 e
 % https://lwn.net/Articles/733256/).
 % TODO aggiunte MADV_COLD e MADV_PAGEOUT dal kernel 5.4, vedi
 % https://git.kernel.org/linus/9c276cc65a58 e
-% https://git.kernel.org/linus/1a4e58cce84e 
+% https://git.kernel.org/linus/1a4e58cce84e
+% TODO: aggiunte MADV_POPULATE_READ e MADV_POPULATE_WRITE (vedi
+% https://lwn.net/Articles/861695/) 
 
 \footnotetext{a partire dal kernel 2.6.32 è stato introdotto un meccanismo che
   identifica pagine di memoria identiche e le accorpa in una unica pagina
 
 \footnotetext{a partire dal kernel 2.6.32 è stato introdotto un meccanismo che
   identifica pagine di memoria identiche e le accorpa in una unica pagina
@@ -5862,6 +5869,12 @@ da fare
 
 % TODO: trattare i file seal, vedi fcntl / F_ADD_SEAL e memfd_create
 
 
 % TODO: trattare i file seal, vedi fcntl / F_ADD_SEAL e memfd_create
 
+% TODO: con il kernel 5.14 è stata introdotta la syscall memfd_secret, vedi
+% https://lwn.net/Articles/835342/ https://lwn.net/Articles/812325/
+% https://lwn.net/Articles/865256/
+% https://lwn.net/ml/linux-mm/20210729082900.1581359-1-rppt@kernel.org/ e
+% https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1507f51255c9 
+
 % TODO trattare qui ioctl_ficlonerange ?
 
 % TODO trattare qui close_range, vedi https://lwn.net/Articles/789023/
 % TODO trattare qui ioctl_ficlonerange ?
 
 % TODO trattare qui close_range, vedi https://lwn.net/Articles/789023/
index 65772744bf8b02534423526b817c07f620510f3e..96c4b5887318df145cafdc0c2d88466953f85f68 100644 (file)
@@ -1,6 +1,6 @@
 %% filedir.tex
 %%
 %% filedir.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -1182,6 +1182,9 @@ utilizzati solo in fase di montaggio:
 %  * http://lwn.net/Articles/159077/ e
 %  * Documentation/filesystems/sharedsubtree.txt
 
 %  * http://lwn.net/Articles/159077/ e
 %  * Documentation/filesystems/sharedsubtree.txt
 
+% TODO: (bassa priorità) trattare mount_setattr, vedi
+% https://lwn.net/Articles/896255/ 
+
 % TODO: (bassa priorità) non documentati ma presenti in sys/mount.h:
 %       * MS_POSIXACL
 %       * MS_KERNMOUNT
 % TODO: (bassa priorità) non documentati ma presenti in sys/mount.h:
 %       * MS_POSIXACL
 %       * MS_KERNMOUNT
@@ -6262,6 +6265,8 @@ gestione delle quote è \funcd{quotactl}, ed il suo prototipo è:
 \end{funcproto}
 
 % TODO rivedere gli errori
 \end{funcproto}
 
 % TODO rivedere gli errori
+% TODO aggiungere quotactl_fd introdotta con il kernel 5.14, vedi
+% https://lwn.net/Articles/859679/ 
 
 La funzione richiede che il filesystem sul quale si vuole operare, che deve
 essere specificato con il nome del relativo file di dispositivo nell'argomento
 
 La funzione richiede che il filesystem sul quale si vuole operare, che deve
 essere specificato con il nome del relativo file di dispositivo nell'argomento
index f6305620b9426ac36594e44fc7ac552760a7def3..59a36147923c8ab77fd33c6d18220159b4fd2e84 100644 (file)
@@ -1,6 +1,6 @@
-s%% fileio.tex (merge fileunix.tex - filestd.tex)
+%% fileio.tex (merge fileunix.tex - filestd.tex)
 %%
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -557,6 +557,7 @@ escludere la possibilità di far esistere il file anche in un secondo tempo.
 
 % NOTE: per O_TMPFILE vedi: http://kernelnewbies.org/Linux_3.11
 % https://lwn.net/Articles/558598/ http://lwn.net/Articles/619146/
 
 % NOTE: per O_TMPFILE vedi: http://kernelnewbies.org/Linux_3.11
 % https://lwn.net/Articles/558598/ http://lwn.net/Articles/619146/
+% https://lwn.net/Articles/896153/
 
 
 \begin{table}[!htb]
 
 
 \begin{table}[!htb]
@@ -1959,6 +1960,9 @@ aggiuntivo sono \textit{system call}, ad esempio \func{faccessat} e
 aderenza allo standard POSIX.1-2008, dato che la \textit{system call}
 sottostante non prevede l'argomento \param{flags}.
 
 aderenza allo standard POSIX.1-2008, dato che la \textit{system call}
 sottostante non prevede l'argomento \param{flags}.
 
+% TODO: nel kernel 6.6 è stata introdotta fchmodat2 che risolve il problema
+% appena illustrato
+
 % TODO: aggiornare per via di faccessat2 aggiunta con il kernel 5.8
 
 In tab.~\ref{tab:at-functions_constant_values} si sono elencati i valori
 % TODO: aggiornare per via di faccessat2 aggiunta con il kernel 5.8
 
 In tab.~\ref{tab:at-functions_constant_values} si sono elencati i valori
index 3b1d0c97103962daae0711287dc9eb18f1b4af54..81c00c5710e7db0500a76309666938b322a218ad 100644 (file)
--- a/gapil.tex
+++ b/gapil.tex
@@ -1,6 +1,6 @@
 %% gapil.tex
 %%
 %% gapil.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.3 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.3 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -136,7 +136,7 @@ hyperfootnotes=false]{hyperref}
 
 \begin{quote}
   
 
 \begin{quote}
   
-  Copyright \copyright\ 2000-2021 Simone Piccardi.  Permission is granted to
+  Copyright \copyright\ 2000-2024 Simone Piccardi.  Permission is granted to
   copy, distribute and/or modify this document under the terms of the GNU Free
   Documentation License, Version 1.3 or any later version published by the
   Free Software Foundation; with the Invariant Sections being ``Un preambolo''
   copy, distribute and/or modify this document under the terms of the GNU Free
   Documentation License, Version 1.3 or any later version published by the
   Free Software Foundation; with the Invariant Sections being ``Un preambolo''
index 4059f5ea05c8fadaad46b3b9dc00b00a83e001ef..74091fced6ed3345ec011fdb034788185420a7a6 100644 (file)
--- a/intro.tex
+++ b/intro.tex
@@ -1,6 +1,6 @@
 %% intro.tex
 %%
 %% intro.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
diff --git a/ipc.tex b/ipc.tex
index 7306d8efd3ac62937c3abebb344433c4018d4d1c..415b2a25f2122d42d469b2475203da6b969317fe 100644 (file)
--- a/ipc.tex
+++ b/ipc.tex
@@ -1,6 +1,6 @@
 %% ipc.tex
 %%
 %% ipc.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 3cd6b92c643399c7d855f5fe027b06e0b58ecee8..9ede6c45c976b73da9cc27a44c423c1aaa0e27db 100644 (file)
--- a/macro.tex
+++ b/macro.tex
@@ -1,6 +1,6 @@
 %% macro.tex
 %%
 %% macro.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 4ed5260559a9e947dcdc98a597731c35566238cc..275b00d8841899e2bfcfcd9e13352d4fd910ab4b 100644 (file)
@@ -1,6 +1,6 @@
 %% netlayer.tex
 %%
 %% netlayer.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index dde8230c6171e0e27670efe095c373c0007cfb11..7672423021e3da133f8bb854f6d5b73caf557937 100644 (file)
@@ -1,6 +1,6 @@
 %% network.tex
 %%
 %% network.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 325fb0d02745c2c674e6c05fbb35ca8d840c2ced..0f7b66572180e86d9b9e8d8b6b4851386cb01b3f 100644 (file)
@@ -1,6 +1,6 @@
 %% othersock.tex
 %%
 %% othersock.tex
 %%
-%% Copyright (C) 2004-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2004-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -801,6 +801,8 @@ stack dei protocolli.
 \subsection{I socket \textit{netlink}}
 \label{sec:socket_netlink}
 
 \subsection{I socket \textit{netlink}}
 \label{sec:socket_netlink}
 
+Vedi \url{https://docs.kernel.org/next/userspace-api/netlink/index.html} 
+
 
 \subsection{I \textit{packet socket}}
 \label{sec:packet_socket}
 
 \subsection{I \textit{packet socket}}
 \label{sec:packet_socket}
index 522eb139567002e742158b37fc13f42d96a48c10..0d51e0e9319145b54e13ac79bdaca7bafa8b0a4d 100644 (file)
@@ -1,6 +1,6 @@
 %% preambolo.tex
 %%
 %% preambolo.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 4659e921032acbbe55cc55a15e8e3084534d65af..03e134f9206956edff693ab2c0bd8ee9dd2da2e4 100644 (file)
--- a/pref.tex
+++ b/pref.tex
@@ -1,6 +1,6 @@
 %% pref.tex
 %%
 %% pref.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index a5ea67f92461d11fe848000979129e21aa59b30e..d8314d74997475b4aff480c3cac122565b488d2a 100644 (file)
@@ -1360,6 +1360,10 @@ essere fornito in una forma di codice interpretabile fornito attraverso un
 socket o una \textit{pipe}, creati prima di lanciare il processo che eseguirà
 il codice non fidato. 
 
 socket o una \textit{pipe}, creati prima di lanciare il processo che eseguirà
 il codice non fidato. 
 
+% TODO: a partire dal kernel 6.6 è stato introdotto
+% SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP that indicates that events from the
+% watched process will be handled synchronously; that allows the kernel to
+% schedule the two processes more efficiently (da LWN)
 
 % TODO a partire dal kernel 3.5 è stato introdotto la possibilità di usare un
 % terzo argomento se il secondo è SECCOMP_MODE_FILTER, vedi
 
 % TODO a partire dal kernel 3.5 è stato introdotto la possibilità di usare un
 % terzo argomento se il secondo è SECCOMP_MODE_FILTER, vedi
@@ -1565,6 +1569,10 @@ all'ordinario valore nullo (dato per implicito).
 %TODO: trattare PR_MPX_*_MANAGEMENT, dal 3.19, vedi
 %      https://lwn.net/Articles/582712/ 
 %TODO: trattare PR_*NO_NEW_PRIVS, dal 3.5
 %TODO: trattare PR_MPX_*_MANAGEMENT, dal 3.19, vedi
 %      https://lwn.net/Articles/582712/ 
 %TODO: trattare PR_*NO_NEW_PRIVS, dal 3.5
+%TODO: trattare il core scheduling dal 5.14, vedi
+%https://lwn.net/Articles/780703/ e https://lwn.net/Articles/861251/
+%TODO: trattare PR_SPEC_L1D_FLUSH vedi https://git.kernel.org/linus/b7fe54f6c2d4
+
 
 \begin{basedescript}{\desclabelwidth{1.5cm}\desclabelstyle{\nextlinelabel}}
 \item[\constd{PR\_CAPBSET\_READ}] Controlla la disponibilità di una delle
 
 \begin{basedescript}{\desclabelwidth{1.5cm}\desclabelstyle{\nextlinelabel}}
 \item[\constd{PR\_CAPBSET\_READ}] Controlla la disponibilità di una delle
@@ -1902,6 +1910,10 @@ Introdotta a partire dal kernel 2.4.21, solo su PowerPC.
 % TODO documentare PR_SET_SYSCALL_USER_DISPATCH in 5.11, vedi
 % https://lwn.net/Articles/826313/
 
 % TODO documentare PR_SET_SYSCALL_USER_DISPATCH in 5.11, vedi
 % https://lwn.net/Articles/826313/
 
+% TODO documentare PR_SET_MDWE in 6.3, vedi
+% https://git.kernel.org/linus/b507808ebce2
+
+
 \label{sec:prctl_operation}
 \end{basedescript}
 
 \label{sec:prctl_operation}
 \end{basedescript}
 
index 57b88739c816f571e3041dc9d0147fbce0f5b0d1..349806e475ddbb3156be7894076773ea0cbd9427 100644 (file)
@@ -1,6 +1,6 @@
 %% process.tex
 %%
 %% process.tex
 %%
-%% Copyright (C) 2000-2019 by Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 by Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 3ee2344c9195736428b2f5535815f6d353e8d751..e02f0fd6a917d25c302ec1757b0c2772d1a1fd38 100644 (file)
@@ -1,6 +1,6 @@
 %% prochand.tex
 %%
 %% prochand.tex
 %%
-%% Copyright (C) 2000-2019 by Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 by Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 6d4e77e1b06faef75afb2016de2a1ecfcf3acecd..c5c75df351fd3621daa39a4b32813492837d2f6d 100644 (file)
@@ -1,6 +1,6 @@
 %% ringraziamenti.tex
 %%
 %% ringraziamenti.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 639cf0dd90d7892a921f4737fcd7f647ef20d3d3..beb46bbe9bd6323e69ff37d04cfb605d0bd05193 100644 (file)
@@ -1,6 +1,6 @@
 %% session.tex
 %%
 %% session.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -44,9 +44,9 @@ Originariamente si trattava di dispositivi specifici (i terminali seriali, se
 non addirittura le telescriventi). Oggi questa interfaccia viene in genere
 emulata o tramite programmi o con le cosiddette console virtuali associate a
 monitor e tastiera, ma esiste sempre la possibilità di associarla direttamente
 non addirittura le telescriventi). Oggi questa interfaccia viene in genere
 emulata o tramite programmi o con le cosiddette console virtuali associate a
 monitor e tastiera, ma esiste sempre la possibilità di associarla direttamente
-ad alcuni dispositivi, come eventuali linee seriali, ed in certi casi, come
-buona parte dei dispositivi embedded su cui gira Linux (come router, access
-point, ecc.) questa resta anche l'unica opzione per una \textit{console} di
+a dispositivi specifici lelinee seriali, che in certi casi, come avviene per
+buona parte dei dispositivi embedded su cui gira Linux come router, access
+point, ecc. sono l'unica opzione per una avere una \textit{console} di
 sistema.
 
 
 sistema.
 
 
@@ -64,7 +64,7 @@ molti terminali in contemporanea da una singola postazione di lavoro, ma il
 sistema è nato prima dell'esistenza di tutto ciò.
 
 Il \textit{job control} è una caratteristica opzionale, introdotta in BSD
 sistema è nato prima dell'esistenza di tutto ciò.
 
 Il \textit{job control} è una caratteristica opzionale, introdotta in BSD
-negli anni '80, e successivamente standardizzata da POSIX.1. La sua
+negli anni '80, e successivamente standardizzata da POSIX.1; la sua
 disponibilità nel sistema è verificabile attraverso il controllo della macro
 \macro{\_POSIX\_JOB\_CONTROL}. In generale il \textit{job control} richiede il
 supporto sia da parte della shell (quasi tutte ormai lo hanno), che da parte
 disponibilità nel sistema è verificabile attraverso il controllo della macro
 \macro{\_POSIX\_JOB\_CONTROL}. In generale il \textit{job control} richiede il
 supporto sia da parte della shell (quasi tutte ormai lo hanno), che da parte
@@ -562,7 +562,7 @@ terminati.
 L'organizzazione del sistema del job control è strettamente connessa alle
 modalità con cui un utente accede al sistema per dare comandi, collegandosi ad
 esso con un terminale, che sia questo realmente tale, come un VT100 collegato
 L'organizzazione del sistema del job control è strettamente connessa alle
 modalità con cui un utente accede al sistema per dare comandi, collegandosi ad
 esso con un terminale, che sia questo realmente tale, come un VT100 collegato
-ad una seriale o virtuale, come quelli associati a schermo e tastiera o ad una
+ad una seriale, o virtuale, come quelli associati a schermo e tastiera o ad una
 connessione di rete. Dato che i concetti base sono gli stessi, e dato che alla
 fine le differenze sono nel dispositivo cui il kernel associa i file standard
 (vedi tab.~\ref{tab:file_std_files}) per l'I/O, tratteremo solo il caso
 connessione di rete. Dato che i concetti base sono gli stessi, e dato che alla
 fine le differenze sono nel dispositivo cui il kernel associa i file standard
 (vedi tab.~\ref{tab:file_std_files}) per l'I/O, tratteremo solo il caso
@@ -695,12 +695,12 @@ Questi programmi, che devono essere eseguiti in modalità non interattiva e
 senza nessun intervento dell'utente, sono normalmente chiamati
 \textsl{demoni}, (o \textit{daemons}), nome ispirato dagli omonimi spiritelli
 della mitologia greca che svolgevano compiti che gli dei trovavano noiosi, di
 senza nessun intervento dell'utente, sono normalmente chiamati
 \textsl{demoni}, (o \textit{daemons}), nome ispirato dagli omonimi spiritelli
 della mitologia greca che svolgevano compiti che gli dei trovavano noiosi, di
-cui parla anche Socrate (che sosteneva di averne uno al suo servizio).
+cui parla anche Socrate, che sosteneva di averne uno al suo servizio.
 
 %TODO ricontrollare, i miei ricordi di filosofia sono piuttosto datati.
 
 Se però si lancia un programma demone dalla riga di comando in un sistema che
 
 %TODO ricontrollare, i miei ricordi di filosofia sono piuttosto datati.
 
 Se però si lancia un programma demone dalla riga di comando in un sistema che
-supporta, come Linux, il \textit{job control} esso verrà comunque associato ad
+supporta il \textit{job control} come Linux, esso verrà comunque associato ad
 un terminale di controllo e mantenuto all'interno di una sessione, e anche se
 può essere mandato in background e non eseguire più nessun I/O su terminale,
 si avranno comunque tutte le conseguenze che abbiamo trattato in
 un terminale di controllo e mantenuto all'interno di una sessione, e anche se
 può essere mandato in background e non eseguire più nessun I/O su terminale,
 si avranno comunque tutte le conseguenze che abbiamo trattato in
@@ -823,7 +823,7 @@ differenti meccanismi come:
 le modalità con cui queste azioni vengono realizzate dipendono ovviamente dal
 demone che si usa, per la gestione del quale si rimanda ad un testo di
 amministrazione di sistema.\footnote{l'argomento è ad esempio coperto dal
 le modalità con cui queste azioni vengono realizzate dipendono ovviamente dal
 demone che si usa, per la gestione del quale si rimanda ad un testo di
 amministrazione di sistema.\footnote{l'argomento è ad esempio coperto dal
-  capitolo 3.2.3 si \cite{AGL}.}
+  capitolo 3.2.3 di \cite{AGL}.}
 
 La \acr{glibc} definisce una serie di funzioni standard con cui un processo
 può accedere in maniera generica al servizio di \textit{syslog}, che però
 
 La \acr{glibc} definisce una serie di funzioni standard con cui un processo
 può accedere in maniera generica al servizio di \textit{syslog}, che però
@@ -1270,9 +1270,9 @@ al di fuori di questo.
 \label{sec:sess_terminal_io}
 
 Benché come ogni altro dispositivo i terminali siano accessibili come file,
 \label{sec:sess_terminal_io}
 
 Benché come ogni altro dispositivo i terminali siano accessibili come file,
-essi hanno assunto storicamente, essendo stati a lungo l'unico modo di
-accedere al sistema, una loro rilevanza specifica, che abbiamo già avuto modo
-di incontrare nella precedente sezione.
+essendo stati a lungo l'unico modo di accedere al sistema essi hanno assunto
+storicamente una loro rilevanza specifica, che abbiamo già avuto modo di
+incontrare nella precedente sezione.
 
 Esamineremo qui le peculiarità dell'I/O eseguito sui terminali, che per la
 loro particolare natura presenta delle differenze rispetto ai normali file su
 
 Esamineremo qui le peculiarità dell'I/O eseguito sui terminali, che per la
 loro particolare natura presenta delle differenze rispetto ai normali file su
index 63a940027b3d5c027e23e0f5d23bbfa596701d1a..7b6cb8eeec6f529d1822d23da12ef0c6b81a500d 100644 (file)
@@ -1,6 +1,6 @@
 %% signal.tex
 %%
 %% signal.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
@@ -2594,12 +2594,16 @@ prototipo è:
 {La funzione ritorna $0$ in caso di successo e $-1$ per un errore, nel qual
   caso \var{errno} assumerà uno dei valori: 
   \begin{errlist}
 {La funzione ritorna $0$ in caso di successo e $-1$ per un errore, nel qual
   caso \var{errno} assumerà uno dei valori: 
   \begin{errlist}
-  \item[\errcode{EFAULT}] si sono specificati indirizzi non validi.
-  \item[\errcode{EINVAL}] si è specificato un numero di segnale invalido.
+  \item[\errcode{EFAULT}] l'indirizzo di \param{mask} non è valido.
+  \item[\errcode{EINTR}] la funzione è stata interrotta da un segnale.
   \end{errlist}
 }
 \end{funcproto}
 
   \end{errlist}
 }
 \end{funcproto}
 
+La funzione imposta la maschera dei segnali indicata da \param{mask} e pone in
+attesa il processo. Ritorna solo con la ricezione di un segnale, con un errore
+di \errval{EINTR}, a meno che il segnale non termini il processo.
+
 Come esempio dell'uso di queste funzioni proviamo a riscrivere un'altra volta
 l'esempio di implementazione di \code{sleep}. Abbiamo accennato in
 sez.~\ref{sec:sig_sigaction} come con \func{sigaction} sia possibile bloccare
 Come esempio dell'uso di queste funzioni proviamo a riscrivere un'altra volta
 l'esempio di implementazione di \code{sleep}. Abbiamo accennato in
 sez.~\ref{sec:sig_sigaction} come con \func{sigaction} sia possibile bloccare
@@ -3017,11 +3021,10 @@ prima di queste è \funcd{sigwait}, il cui prototipo è:
 \fdecl{int sigwait(const sigset\_t *set, int *sig)}
 \fdesc{Attende la ricezione di un segnale.} 
 }
 \fdecl{int sigwait(const sigset\_t *set, int *sig)}
 \fdesc{Attende la ricezione di un segnale.} 
 }
-{La funzione ritorna $0$ in caso di successo e $-1$ per un errore, nel qual
-  caso \var{errno} assumerà uno dei valori
+{La funzione ritorna $0$ in caso di successo ed un valore positivo in caso di
+  errore con valore secondo la lista seguente
   \begin{errlist}
   \begin{errlist}
-  \item[\errcode{EINTR}] la funzione è stata interrotta.
-  \item[\errcode{EINVAL}] si è specificato un valore non valido per
+  \item[\errcode{EINVAL}] \param{set} contiene un numero di segnale non valido 
   \end{errlist}
   ed inoltre \errval{EFAULT} nel suo significato generico.}
 \end{funcproto}
   \end{errlist}
   ed inoltre \errval{EFAULT} nel suo significato generico.}
 \end{funcproto}
@@ -3095,14 +3098,6 @@ che venga eseguita l'azione predefinita, devono essere mascherati per tutti i
 \textit{thread}, compreso quello dedicato alla gestione, che potrebbe
 riceverlo fra due chiamate successive.
 
 \textit{thread}, compreso quello dedicato alla gestione, che potrebbe
 riceverlo fra due chiamate successive.
 
-Come esempio elementare dell'uso dei segnali \textit{real-time}, e della
-possibilità di inviare informazioni al gestore degli stessi con
-\func{sigqueue}, si è riportato in fig.~\ref{fig:sig_rtsival_main} il corpo
-principale di un programma elementare che legge dal terminale un valore
-numerico, ed utilizza un segnale \textit{real-time} per inviarlo al gestore
-dello stesso. Si sono trascurati i controlli dei valori di ritorno delle varie
-funzioni per brevità.
-
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{\codesamplewidth}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{\codesamplewidth}
@@ -3114,11 +3109,19 @@ funzioni per brevità.
   \label{fig:sig_rtsival_main}
 \end{figure}
 
   \label{fig:sig_rtsival_main}
 \end{figure}
 
+Come esempio elementare dell'uso dei segnali \textit{real-time}, e della
+possibilità di inviare informazioni al gestore degli stessi con
+\func{sigqueue}, si è riportato in fig.~\ref{fig:sig_rtsival_main} il corpo
+principale di un programma elementare che legge dal terminale un valore
+numerico, ed utilizza un segnale \textit{real-time} per inviarlo al gestore
+dello stesso. Nel codice sono stati trascurati i controlli dei valori di
+ritorno delle varie funzioni per mantenere la brevità dell'esempio.
+
 Dopo aver definito (\texttt{\small 5}) una variabile \var{value} di tipo
 Dopo aver definito (\texttt{\small 5}) una variabile \var{value} di tipo
-\type{sigval\_t} per inviare i dati, ed aver opportunamente scelto
+\type{sigval\_t} per poter inviare i dati, e dopo aver opportunamente scelto
 (\texttt{\small 6}) per \var{signo} un segnale \textit{real-time}, la parte
 iniziale del programma (\texttt{\small 8--11}) installa il relativo gestore
 (\texttt{\small 6}) per \var{signo} un segnale \textit{real-time}, la parte
 iniziale del programma (\texttt{\small 8--11}) installa il relativo gestore
-(la cui definizione è riportata in fig.~\ref{fig:sig_rtsival_handl}), dopo di
+(la cui definizione è riportata in fig.~\ref{fig:sig_rtsival_handl}).  Dopo di
 che il programma si pone in un ciclo infinito (\texttt{\small 14--27}) in cui
 prima (\texttt{\small 15--20}) legge in buffer dallo \textit{standard input}
 una stringa immessa dall'utente, terminandola opportunamente (\texttt{\small
 che il programma si pone in un ciclo infinito (\texttt{\small 14--27}) in cui
 prima (\texttt{\small 15--20}) legge in buffer dallo \textit{standard input}
 una stringa immessa dall'utente, terminandola opportunamente (\texttt{\small
@@ -3128,6 +3131,10 @@ conversione ha successo e \texttt{value.sival\_int} è positivo) invia a se
 stesso (\texttt{\small 23}) il segnale \textit{real-time}, altrimenti stampa
 un avviso (\texttt{\small 24}).
 
 stesso (\texttt{\small 23}) il segnale \textit{real-time}, altrimenti stampa
 un avviso (\texttt{\small 24}).
 
+Alla ricezione del segnale il gestore si limita a stampare alcune delle
+informazioni ricevute nella struttura \struct{sigval\_t}, ed in particolare
+(\texttt{\small 5}) stampa tramite il valore del campo \var{si\_value} il
+numero che gli è stato inviato da \func{sigqueue}.
 
 \begin{figure}[!htb]
   \footnotesize \centering
 
 \begin{figure}[!htb]
   \footnotesize \centering
@@ -3135,14 +3142,12 @@ un avviso (\texttt{\small 24}).
     \includecodesample{listati/rtsigvalsend_handl.c}
   \end{minipage} 
   \normalsize 
     \includecodesample{listati/rtsigvalsend_handl.c}
   \end{minipage} 
   \normalsize 
-  \caption{Codice del gestore.}
+  \caption{Codice del gestore usato dal programma di
+    fig.~\ref{fig:sig_rtsival_main}.} 
   \label{fig:sig_rtsival_handl}
 \end{figure}
 
 
   \label{fig:sig_rtsival_handl}
 \end{figure}
 
 
-
-
-
 \subsection{La gestione avanzata delle temporizzazioni}
 \label{sec:sig_timer_adv}
 
 \subsection{La gestione avanzata delle temporizzazioni}
 \label{sec:sig_timer_adv}
 
@@ -3191,20 +3196,6 @@ alta definizione però erano già presenti, essendo stata introdotte insieme ad
 altre funzioni per il supporto delle estensioni \textit{real-time} con il
 rilascio del kernel 2.6, ma la risoluzione effettiva era nominale.
 
 altre funzioni per il supporto delle estensioni \textit{real-time} con il
 rilascio del kernel 2.6, ma la risoluzione effettiva era nominale.
 
-A tutte le implementazioni che si rifanno a queste estensioni è richiesto di
-disporre di una versione \textit{real-time} almeno per l'orologio generale di
-sistema, quello che mantiene il \textit{calendar time} (vedi
-sez.~\ref{sec:sys_time_base}), che in questa forma deve indicare il numero di
-secondi e nanosecondi passati a partire dal primo gennaio 1970 (\textit{The
-  Epoch}). Si ricordi infatti che l'orologio ordinario usato dal
-\textit{calendar time} riporta solo un numero di secondi, e che la risoluzione
-effettiva normalmente non raggiunge il nanosecondo (a meno di hardware
-specializzato).  Oltre all'orologio generale di sistema possono essere
-presenti altri tipi di orologi \textit{real-time}, ciascuno dei quali viene
-identificato da un opportuno valore di una variabile di tipo
-\type{clockid\_t}; un elenco di quelli disponibili su Linux è riportato in
-tab.~\ref{tab:sig_timer_clockid_types}.
-
 \begin{table}[htb]
   \footnotesize
   \centering
 \begin{table}[htb]
   \footnotesize
   \centering
@@ -3262,6 +3253,19 @@ tab.~\ref{tab:sig_timer_clockid_types}.
   \label{tab:sig_timer_clockid_types}
 \end{table}
 
   \label{tab:sig_timer_clockid_types}
 \end{table}
 
+A tutte le implementazioni che si rifanno a queste estensioni è richiesto di
+disporre di una versione \textit{real-time} almeno per l'orologio generale di
+sistema, quello che mantiene il \textit{calendar time} (vedi
+sez.~\ref{sec:sys_time_base}), che in questa forma deve indicare il numero di
+secondi e nanosecondi passati a partire dal primo gennaio 1970 (\textit{The
+  Epoch}). Si ricordi infatti che l'orologio ordinario usato dal
+\textit{calendar time} riporta solo un numero di secondi, e che la risoluzione
+effettiva normalmente non raggiunge il nanosecondo (a meno di hardware
+specializzato).  Oltre all'orologio generale di sistema possono essere
+presenti altri tipi di orologi \textit{real-time}, ciascuno dei quali viene
+identificato da un opportuno valore di una variabile di tipo
+\type{clockid\_t}; un elenco di quelli disponibili su Linux è riportato in
+tab.~\ref{tab:sig_timer_clockid_types}.
 
 % TODO: dal 4.17 CLOCK_MONOTONIC e CLOCK_BOOTTIME sono identici vedi
 % https://lwn.net/Articles/751651/ e
 
 % TODO: dal 4.17 CLOCK_MONOTONIC e CLOCK_BOOTTIME sono identici vedi
 % https://lwn.net/Articles/751651/ e
@@ -3331,17 +3335,17 @@ stata inizializzata con il valore che si vuole impostare sull'orologio, mentre
 per \func{clock\_gettime} verrà restituito al suo interno il valore corrente
 dello stesso.
 
 per \func{clock\_gettime} verrà restituito al suo interno il valore corrente
 dello stesso.
 
-Si tenga presente inoltre che per eseguire un cambiamento sull'orologio
-generale di sistema \const{CLOCK\_REALTIME} occorrono i privilegi
-amministrativi;\footnote{ed in particolare la \textit{capability}
-  \const{CAP\_SYS\_TIME}.} inoltre ogni cambiamento ad esso apportato non avrà
-nessun effetto sulle temporizzazioni effettuate in forma relativa, come quelle
-impostate sulle quantità di \textit{process time} o per un intervallo di tempo
-da trascorrere, ma solo su quelle che hanno richiesto una temporizzazione ad
-un istante preciso (in termini di \textit{calendar time}). Si tenga inoltre
-presente che nel caso di Linux \const{CLOCK\_REALTIME} è l'unico orologio per
-cui si può effettuare una modifica, infatti nonostante lo standard preveda la
-possibilità di modifiche anche per \const{CLOCK\_PROCESS\_CPUTIME\_ID} e
+Per eseguire un cambiamento sull'orologio generale di sistema
+\const{CLOCK\_REALTIME} occorrono i privilegi amministrativi;\footnote{ed in
+  particolare la \textit{capability} \const{CAP\_SYS\_TIME}.} e che ogni
+cambiamento ad esso apportato non avrà nessun effetto sulle temporizzazioni
+effettuate in forma relativa, come quelle impostate sulle quantità di
+\textit{process time} o per un intervallo di tempo da trascorrere, ma solo su
+quelle che hanno richiesto una temporizzazione ad un istante preciso (in
+termini di \textit{calendar time}). Si tenga inoltre presente che nel caso di
+Linux \const{CLOCK\_REALTIME} è l'unico orologio per cui si può effettuare una
+modifica, infatti nonostante lo standard preveda la possibilità di modifiche
+anche per \const{CLOCK\_PROCESS\_CPUTIME\_ID} e
 \const{CLOCK\_THREAD\_CPUTIME\_ID}, il kernel non le consente.
 
 Oltre alle due funzioni precedenti, lo standard POSIX prevede una terza
 \const{CLOCK\_THREAD\_CPUTIME\_ID}, il kernel non le consente.
 
 Oltre alle due funzioni precedenti, lo standard POSIX prevede una terza
@@ -3377,16 +3381,15 @@ voglia utilizzare nelle funzioni di impostazione che non corrisponda ad un
 multiplo intero di questa risoluzione, sarà troncato in maniera automatica. 
 
 Gli orologi elencati nella seconda sezione di
 multiplo intero di questa risoluzione, sarà troncato in maniera automatica. 
 
 Gli orologi elencati nella seconda sezione di
-tab.~\ref{tab:sig_timer_clockid_types} sono delle estensioni specifiche di
-Linux, create per rispondere ad alcune esigenze specifiche, come quella di
-tener conto di eventuali periodi di sospensione del sistema, e presenti solo
-nelle versioni più recenti del kernel. In particolare gli ultimi due,
-contraddistinti dal suffisso \texttt{\_ALARM}, hanno un impiego particolare,
-derivato dalle esigenze emerse con Android per l'uso di Linux sui cellulari,
-che consente di creare timer che possono scattare, riattivando il sistema,
-anche quando questo è in sospensione. Per il loro utilizzo è prevista la
-necessità di una capacità specifica, \const{CAP\_WAKE\_ALARM} (vedi
-sez.~\ref{sec:proc_capabilities}).
+tab.~\ref{tab:sig_timer_clockid_types} sono estensioni specifiche di Linux
+presenti solo nelle versioni più recenti del kernel, create per rispondere ad
+alcune esigenze specifiche come quella di tener conto di eventuali periodi di
+sospensione del sistema. In particolare gli ultimi due, contraddistinti dal
+suffisso \texttt{\_ALARM}, hanno un impiego particolare derivato dalle
+esigenze emerse con Android per l'uso di Linux sui cellulari, che consente di
+creare timer che possono scattare, riattivando il sistema, anche quando questo
+è in sospensione. Per il loro utilizzo è prevista la necessità di una capacità
+specifica, \const{CAP\_WAKE\_ALARM} (vedi sez.~\ref{sec:proc_capabilities}).
 
 Si tenga presente inoltre che con l'introduzione degli \textit{high resolution
   timer} i due orologi \const{CLOCK\_PROCESS\_CPUTIME\_ID} e
 
 Si tenga presente inoltre che con l'introduzione degli \textit{high resolution
   timer} i due orologi \const{CLOCK\_PROCESS\_CPUTIME\_ID} e
@@ -3888,10 +3891,10 @@ anch'essa introdotta dallo standard POSIX.1, il suo prototipo è:
 La funzione permette di ricavare quali sono i segnali pendenti per il processo
 in corso, cioè i segnali che sono stati inviati dal kernel ma non sono stati
 ancora ricevuti dal processo in quanto bloccati. Non esiste una funzione
 La funzione permette di ricavare quali sono i segnali pendenti per il processo
 in corso, cioè i segnali che sono stati inviati dal kernel ma non sono stati
 ancora ricevuti dal processo in quanto bloccati. Non esiste una funzione
-equivalente nella vecchia interfaccia, ma essa è tutto sommato poco utile,
-dato che essa può solo assicurare che un segnale è stato inviato, dato che
-escluderne l'avvenuto invio al momento della chiamata non significa nulla
-rispetto a quanto potrebbe essere in un qualunque momento successivo.
+equivalente nella vecchia interfaccia, ma essa, potendo solo assicurare che un
+segnale è stato inviato, è tutto sommato poco utile dato che escluderne
+l'avvenuto invio al momento della chiamata non significa nulla rispetto a
+quanto potrebbe accadere in un qualunque momento successivo.
 
 Una delle caratteristiche di BSD, disponibile anche in Linux, è la possibilità
 di usare uno \textit{stack} alternativo per i segnali; è cioè possibile fare
 
 Una delle caratteristiche di BSD, disponibile anche in Linux, è la possibilità
 di usare uno \textit{stack} alternativo per i segnali; è cioè possibile fare
index a9e4cd530383947868624e9cf6fcbe7967089df9..8eede0482c7b3bdc38071c09d910cd2ba2dcdf9b 100644 (file)
@@ -1,6 +1,6 @@
 %% sockadv.tex
 %%
 %% sockadv.tex
 %%
-%% Copyright (C) 2004-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2004-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 9d5279e6ab62856b34ff617697608b440c23c03e..19f9ddccdea8e20eb743badfb0f1b57f16ed6173 100644 (file)
@@ -1,6 +1,6 @@
 %% sockctrl.tex
 %%
 %% sockctrl.tex
 %%
-%% Copyright (C) 2004-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2004-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Prefazione",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Prefazione",
@@ -2669,8 +2669,10 @@ tab.~\ref{tab:sock_opt_socklevel} sul significato delle varie opzioni:
 \item[\constd{SO\_TYPE}] questa opzione permette di leggere il tipo di socket
   su cui si opera; funziona solo con \func{getsockopt}, ed utilizza per
   \param{optval} un intero in cui verrà restituito il valore numerico che lo
 \item[\constd{SO\_TYPE}] questa opzione permette di leggere il tipo di socket
   su cui si opera; funziona solo con \func{getsockopt}, ed utilizza per
   \param{optval} un intero in cui verrà restituito il valore numerico che lo
-  identifica (ad esempio \const{SOCK\_STREAM}). 
-
+  identifica (ad esempio \const{SOCK\_STREAM}).
+  
+% TODO verificare IP_LOCAL_PORT_RANGE, aggiunta con il 6.3
+% vedi https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91d0b78c5177
 
 \end{basedescript}
 
 
 \end{basedescript}
 
index b01ff3aa67a6f224db9e52899f7397e46daa406e..51bdad7768d03ebe1d2d7a7f712cbd8ed784db3f 100644 (file)
@@ -1,6 +1,6 @@
 %% socket.tex
 %%
 %% socket.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
diff --git a/sources/sigwait.c b/sources/sigwait.c
new file mode 100644 (file)
index 0000000..7dcc983
--- /dev/null
@@ -0,0 +1,66 @@
+/* sigwait.c
+ * 
+ * Copyright (C) 2021 Simone Piccardi
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/****************************************************************
+ *
+ * Program sigwait.c: 
+ * Test program for sigwait function
+ *
+ * Author: Simone Piccardi
+ * Nov. 2021
+ *
+ ****************************************************************/
+/* 
+ * Include needed headers
+ */
+#define _GNU_SOURCE
+#include <unistd.h>      /* unix standard library */
+#include <signal.h>      /* signal constants, types and functions */
+#include <errno.h>       /* error definitions and routines */ 
+#include <stdlib.h>      /* C standard library */
+#include <unistd.h>      /* unix standard library */
+#include <stdio.h>      /* standard I/O library */
+#include <string.h>      /* C strings library */
+
+int main(int argc, char *argv[])
+{
+/* 
+ * Variables definition  
+ */
+    int i;
+    pid_t pid = 0;
+    int sig,res;
+    sigset_t set;
+
+    sigemptyset(&set);
+    sigaddset(&set, SIGALRM);
+//    while (1) {
+    res=sigwait(&set, &sig);
+    printf("Sig was %d", sig);
+    if ( res > 0) {
+       printf("Errno was %d", errno);
+       perror("errore");
+       printf("Result was %d", res);
+       printf("Error by res was %s", strerror(res));
+       exit(11);
+    } else {
+       printf("Result was %d", res);
+       printf("Normal exit");
+    }
+//    }
+}
index a761b4dcd31e2431c3ea9f19294975863f1ee21f..671b1029c733bbae7c8acf9e5e00113c89bd33be 100644 (file)
@@ -1,6 +1,6 @@
 %% system.tex
 %%
 %% system.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 5951a91107a872bde436424df1adaa7ce8cfe96a..525867ecdcc3d038f741b97bec23e445bdc8c3d2 100644 (file)
@@ -1,6 +1,6 @@
 %% tcpsock.tex
 %%
 %% tcpsock.tex
 %%
-%% Copyright (C) 2000-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2000-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 62f4dfdf7e9bc388c02835965d9a36b120d6c0d5..b0679203e9cab2ab7a32e6b3926cd35af44e65cb 100644 (file)
@@ -1,6 +1,6 @@
 %% thread.tex
 %%
 %% thread.tex
 %%
-%% Copyright (C) 2007-2019 Simone Piccardi.  Permission is granted to
+%% Copyright (C) 2007-2024 Simone Piccardi.  Permission is granted to
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% copy, distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
index 97b0efb7eaf28755b8d2ed3d428fbaed5100b823..4493730c46a25b5e4d88264374973452dfdba801 100644 (file)
@@ -1,6 +1,6 @@
 %% tcpprot.tex
 %%
 %% tcpprot.tex
 %%
-%% Copyright (C) 2002-2019 Simone Piccardi.  Permission is granted to copy,
+%% Copyright (C) 2002-2024 Simone Piccardi.  Permission is granted to copy,
 %% distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
 %% distribute and/or modify this document under the terms of the GNU Free
 %% Documentation License, Version 1.1 or any later version published by the
 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",