Avoid warning about sys/sysctl.h on glibc-2.30. From glibc-2.30 NEWS: The Linux-specific <sys/sysctl.h> header and the sysctl function have been deprecated and will be removed from a future version of glibc. Compilation against the glibc-2.30 headers results in the following warning: In file included from ipc.c:10: /usr/include/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp] On NetBSD and FreeBSD, however, we still need to include the header to get the declaration of sysctlbyname(3). This patch changes ipc.c to include sys/sysctl.h only if __FreeBSD__ or __NetBSD__ is defined. Also remove the pointless check for __APPLE__.
Shorten copyright notice. The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
doxygen: Add \ref to references. This way doxygen issues a warning if the file/function/structure no longer exists and a stale reference remains.
load_chunk_table(): Don't trust afhi->chunks_total. Both callers pass a buffer to load_chunk_table() to initialize afhi->chunk_table. The function does not check the size of the passed buffer but relies on afhi->chunks_total to tell how many values to copy from the buffer. In other words, the buffer size gives an upper bound for the number of chunks in the chunk table, but this bould is not checked. This patch makes the code more robust by adding a suitable check. To this aim, load_chunk_table() is changed to receive a pointer to an osl object (which contains the buffer size) rather than only the buffer. One caller, load_afd(), initializes the chunk table from a shared memory area buffer. It does not know or care about the buffer size so far. We introduce the the new IPC helper shm_size() to let it tell the size of the area and pass it to load_chunk_table().
Update year in copyright headers. Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
doc: Change email address to maan@tuebingen.mpg.de The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
Change copyright year to 2014. This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
ipc: Close proc fd. We read shmmax only once, so there is no point in keeping this file descriptor open forever.
ipc.c: Fix typo in comment.
Change copyright year to 2013. Better late than never.
Change year in copyright message to 2012.
doc: Add some missing doxygen comments.
ipc: Determine maximal size of a shared memory area at runtime. During command dispatch, the afs process allocates shm areas for the query result and passes the identifiers via the local socket to the child process of para_server which is executing the command. If the write to the (non-blocking) local socket fails, for example because the call would block, afs closes the connection to the child process immediately to avoid deadlocks. Therefore the maximal output size of an (afs) command depends linearly on the size of the shared memory areas, so it is desirable to allocate areas as large as possible. Currently, we use the SHMMAX if it is defined and fall back to the safe default value of 64K otherwise. However, this default is much smaller than the typical limit of 32M on Linux. Moreover, the maximal size of a shared memory area (shmmax) can be set at any time on most if not all operating systems, so runtime detection of shmmax is to be preferred. Unfortunately the way to obtain shmmax varies between operating systems. On Linux, the value is available as the contents of a file in /proc while on {Free,Net}BSD and Darwin sysctlbyname() must be called. Moreover, BSD and Darwin use different identifiers for the sysctlbyname() call. So any code that determines shmmax at runtime and works on all of the above systems must necessarily be ugly. This patch tries to concentrate all ugliness in the new shm_get_shmmax() function, so that the changes outside of ipc.c consist only of replacements SHMMAX -> shm_get_shmmax() and of the removal of the default SHMMAX setting. The new function only determines shmmax once when it is called for the first time.
Replace 2010 in copyright message by 2011.
Change year in COPYRIGHT to 2010. Hey, this is earlier than last year :)
Change year of copyright from 2008 to 2009.
Replace ipc error codes by system error codes.
ipc.c: Cosmetics.
Change year in Copyright comment from 2007 to 2008.
Fix some gcc warnings on Solaris: warning: int format, pid_t arg warning: int format, long int arg int format, uid_t arg int format, gid_t arg