Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7085733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:27:40+00:00 2026-05-28T07:27:40+00:00

I researched the Linux kernel code (2.6.11) about the creation of a process/thread, and

  • 0

I researched the Linux kernel code (2.6.11) about the creation of a process/thread, and followed do_fork()->alloc_pidmap()

It seems that alloc_pidmap always returns pid > 300 once the previous pid’s ever reached the max pid, while actually daemon’s pid is always < 300 (Is this correct?).

Does a daemon obtain its pid using a function other than alloc_pidmap()? If so, does it imply the daemon process is not created using do_fork?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:27:41+00:00Added an answer on May 28, 2026 at 7:27 am

    AFAIK pid are allocated by the kernel; the limit of 300 (i.e. #define RESERVED_PIDS 300 private inside kernel/pid.c) you are seeing is perhaps because on most systems, several processes have been forked early in the bootstrap (e.g. from initrd perhaps).

    You could test by booting from GRUB directly into a kernel with init=/bin/sh

    Some processes are kernel processes (without userland code, e.g. kworker or kauditd), which are not started by fork from init or descendants. They are probably started with kthread_create inside the kernel (and without any syscall).

    And you should explain why are you asking that. Is your question about determining if a process is a deamon or not?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing so research trying to find the code in the Linux kernel
I'm working with Django on Linux and I have an application that integrates with
I build an application on a machine running Linux (Debian) with kernel 2.6.26-2-amd64 and
We have a smallish C++ Linux project that accompanies our large C++/MFC Windows project.
I'm looking for a linux utility that can alter the payloads of network packets
I want to work with the Linux kernel, but I have no idea where
I am currently writing a linux application in C that reads from a configuration
I'd like to write a simple linux CLI application that can take 2 video
I'm in the process of porting a large C++ application from Linux (gcc) to
Ok, I need to write a code that calls a script, and if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.