Tips corner
This page provides technical tips related to computer sciences essentially in the Linux environment. |
||
30 October 2022 |
Monitoring /proc files efficiently | Monitoring /proc files without continuously reopening them. |
23 October 2022 |
Hidden feature of getopts command | This article makes us discover the ability to use "-" as an option on the command line of the shell scripts. |
23 October 2022 |
Unexpected systemd's watchdog timeout | This article explains why a systemd watchdog timeout can occur in case of a file descriptor leak. |
14 August 2022 |
Why shell built-ins are also available as programs? | This article explains why a shell built-in command like echo is also available as an executable program. |
20
May 2022 |
Making localtime() faster | This article explains why localtime() triggers a failing open() system call which impacts the performances. |
24
Apr 2022 |
Systemd does not benefit from VDSO | This article explains why systemd still uses clock_gettime() as a system call despite the VDSO activation in the Linux kernel. |
07
Apr 2022 |
Slow-down in systemd | This article describes a source of slow-down due to bothering ioctl() calls in systemd. This is especially visible when it manages the watchdog refresh messages. |
25
Mar 2022 |
Reason why a Linux core file can be truncated | This article describes why a process supervised by systemd can generate a truncated core file when it is stopped. |
12
Dec 2021 |
Implementation of a producer/consumer algorithm in C language | This article describes the implementation of a producer/consumer algorithm in C language with the services related to the pthread condition variables. |
07
Nov 2021 |
System call overload with stack backtrace | This article describes how to overload a Linux system call to display its call stack. |
06
Jun 2021 |
Translation of UTF-16LE into ASCII | This article describes how to convert UTF-16LE strings into ASCII in C language. |
05
January 2021 |
Software/Hardware upgrade of a Windows PC | This article describes step by step the hardware/Software upgrade of a PC running Windows 10 to make it more performant. |
20
December 2020 |
Possible bug in pthread_yield() | This article focuses on a possible bug in the implementation of pthread_yield() service in the GLIBC. |
12
December 2020 |
How an untouched local variable makes a thread crash | This article explains why a thread entry point defining a huge variable makes the thread crash although the variable is not touched. |
01
September 2020 |
Using sendfile() to copy files | To copy some memory mapped files into dump files. One may use dd shell command. But it is not the most efficient way to make it. |
13
July 2020 |
Using GCC sections to reorder the code | To increase the cache locality and reduce the icache misses, it may be useful to group hot functions into memory. The ability of GCC to arrange data and code into sections can be used to make it. |
15
April 2020 |
Host's name in the prompt of bash | Why the host's name is not updated in the prompt of bash ? |
20
October 2019 |
Value of "%h" in "/proc/sys/kernel/core_pattern" |
Which host name "%h" is ? The initial uts_namespace or the crashing task's one ? |
14
May 2019 |
Is "%m" format reentrant ? |
Can we use the "%m" format in printf-like functions in multithreaded programs ? |
25
December 2013 |
Thread's stack memory consumption |
The implicit virtual memory consumption when a process creates and terminates threads. |
07
August 2012 |
The GCC nonnull attribute and compiler optimizations |
The impacts of the compiler optimizations when the GCC nonnull attribute is used. |
02
January 2016 |
How to make executable shared
libraries |
How to make shared
libraries become executable programs. |
28
April 2011 | Why a thread
creation could fail ? |
The pthread_create() service from the pthread (NPTL) library, may fail returning the ENOMEM or EAGAIN error. This papers focuses on the reason why this could happen and how to solve the problem. |
31
May 2010 | Is inet_ntoa() reentrant ? | How to use inet_ntoa()
in a reentrant and MT-safe way. |
01
January 2009 | How to use printf() efficiently | Tip to use the C library printf() function efficiently. |
31
March 2008 | Making and managing shared objects in GNU/Linux environment | Tip to generate shared libraries correctly in order to ensure that static constructors and destructors will be called. |
06
April 2008 | Hard links to save space on file systems | How to save (RAM)disk space and enhance the file system accesses by using hard links instead of symbolic links. |