Diễn đàn mansion

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2020-09-14 13:02:37

ShaniceCas
Member
From: Austria, Laafeld
Registered: 2020-09-14
Posts: 1

Continue reading Tags:

Category:  Operating System s.
Helper functions for handling the PID file of a  background  daemon.
Filed under:.

— Leave a comment        October 19

2014                 In this article I will present to you some useful functions for handling the PID file of a background daemon.
Most of  the background  daemons maintain a PID file usually in a well-known path such as the “/var/run”.
For example, the GNOME Display Manager which runs as a background daemon (gdm3) maintains the  following  file “/var/run/gdm3.pid”.
A PID file contains the PID number of the daemon process  currently  running.
This  information  is useful either for validation or for sending various signals to the daemon process.
Also, if a  background  daemon must have a single running instance this can be accomplished by checking if the PID number of the PID file really exists in the system.
Continue reading              Tags: , , , , PID,                 Read More & Comment                                     Useful  functions  for enabling and disabling the non-blocking I/O mode of file descriptors.
Filed under:.

— Leave a comment        October 18

2014                 In this article I will present to you two useful functions that can be used whenever you want to enable or disable the non-blocking I/O mode of a file descriptor.
By using the enable_io_blocking_for_file_descriptor and disable_io_blocking_for_file_descriptor  functions  you can enable and disable the I/O blocking of a file descriptor.

Continue reading              Tags: file descriptor

, , I/O, non-blocking, ,                 Read More & Comment                                     A safe wrapper implemented in C for freeing dynamic allocated memory.
Filed under: ,  — Leave a comment                       In this article I will present to you a safe wrapper for freeing memory allocated with *alloc family  functions .
The standard function “void free (void * pointer)” from stdlib library does not check the given pointer to see whether it is NULL and does not NULL terminate the pointer before it returns either.
So, setting a pointer to NULL after freeing is considered a good practice, and can reduce the chances of unpredictable behavior if the memory is later accessed; segmentation faults when the memory is no longer accessible and potential security risks.

Continue reading              Tags: allocation

free, , , macro, memory, , , wrapper                Read More & Comment                                     Macro definitions for handling interruptible POSIX system calls.
Filed under:.

— Leave a comment        October 16

2014                 In this article I will present to you some macro definitions for handling interruptible system calls.

Continue reading              Tags: EAGAIN

EINTR, EWOULDBLOCK, , , , macro, , , system call                Read More & Comment                                     Implementation of functions in C for software signal management in POSIX operating systems – Version 2.
Filed under:.

— Leave a comment        October 14

2014                 In this article I will present to you a mechanism written in C for handling efficiently software signals in POSIX operating systems.
The first thing you have to do is to create the configuration of the signals you want to support.
After you decide the appropriate configuration you have to setup the signals support and register the configuration.
Later on, when the various software signals occur a generic signal dispatcher will handle the signals according to the specified configuration.
Continue reading              Tags: , , , , signal dispatcher, signal handlers                Read More & Comment                                     Implementation of a C function to convert a typical process into a background service (Daemon) – Version 2.
Filed under:.

— Leave a comment        October 8

2014                 In a previous article I had shown to you how a typical process in GNU/Linux operating systems can be converted to a background daemon process.
The source code from the previous article was taken from an old project I wrote years ago.
Nowadays, I have rewritten the daemonizing function in a new project and I think it could be nice to share it.
I have simplified the function and now it has a clearer and simpler API.
Continue reading              Tags: , , , , , , service                Read More & Comment                                     Protection of critical regions of a process in GNU/Linux.
Filed under:.

— Leave a comment        March 7

2011                 Below, we quote a function for managing a transaction in a hypothetical transaction management system.
It is very likely multiple instances of the function to be executed in parallel on a system of symmetric multiprocessing (SMP), on multi-processor platforms or even a multithreaded single processor systems.

Continue reading              Tags: critical region

deadlock, , , , , , pthread, race condition, transaction                Read More & Comment                                     Implementation of a C function to convert a typical process into a background service (Daemon) – Version 1.
Filed under: ,  — 2 Comments        July 15, 2010                 Below I quote a function in C to convert a standard Linux kernel process into background service (Daemon Service).
If you wish to develop a server to provide services, it may be helpful.
Although there are several manuals on the Internet on how to create background services, most of them don’t show a complete example, while others are barely functioning.
The following function converts a standard process into a service taking everything you need into account.
Also, this function is the result of a combination of several textbooks and numerous studies about this issue.
Finally, it has been tested on personal applications servers and it is performing well.
Continue reading              Tags: , , , , , , service                Read More & Comment                                     Implementation of functions in C for software signal management in POSIX operating systems – Version 1.
Filed under: ,  — Leave a comment                       Below I quote a simple implementation in C that you can use in your applications for the management of software signals in POSIX operating systems (such as the GNU/Linux).
Of course, this implementation comes from a personal project of the past, especially where I grappled with system programming.
You can modify this implementation to work best with your needs.

Continue reading                        Tags:

, , , signal handler, signal management, zombie process                Read More & Comment                                     Function implementation to generate true random numbers from the Linux kernel.
Filed under: ,  — Leave a comment                       Before I mention the function that I have developed for the production of random numbers from the monolithic Linux kernel, I would first like to say something about the issue of random numbers.
The issue of producing truly random numbers is important and had even since the beginning puzzled computer scientists.
In mathematics, it is very difficult to define the random and, generally, randomness is very difficult to prove with no assumptions.
In the past, many scientists tried to develop mathematical models and algorithms to develop random number generators.
One of the greatest scientists of Computer Science, John von Neumann (the basic idea of the architecture of all computer systems today was his own design) jokingly said: ‘Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin.’.

Continue reading              Tags: entropy

, , , kernel, , , pseudodevice, random numbers, urandom                Read More & Comment.
(79).
(21).
(15).
(26).
(4).
(7).
(55).
(24).
(4).
(16).
(14).
(4).
(7).
Operating Systems (10).
(78).
(11).
(9).
(1).
September 2020      M  T  W  T  F  S  S           123456      78910111213      14151617181920      21222324252627      282930           « Oct.
(2).
(4).
(1).
(1).
(2).
(1).
(1).
(1).
(2).
(1).
(9).
(1).
(8).
(1).
(1).
(2).
(4).
(7).
(1).
(1).
(1).
(8).
(12).
(1).
(2).
(1).
(2).
(1).
(2).
(1).
(1).
(4).
(20).
(13).
(5).
(2).
(10).
(13).
(10).
(10).
(20).
287,004 hits.

Offline

Board footer

Powered by FluxBB