Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
When and how a process control block is created
#include <stdio.h>

int main(void)
{
    return 0;
}

When and how a process control block is created for above program?

For example,before the above program comes into running state ,kernel must allocate a pcb for this process.

Where can i find the various starting system calls made to the kernel ,So that i can trace these calls into the kernel.

I ran an strace on the above program but i can't get it.

execve("./a.out", ["./a.out"], [/* 42 vars */]) = 0
brk(0)                                  = 0x9aaf000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or      directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78df000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=112037, ...}) = 0
mmap2(NULL, 112037, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb78c3000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220o\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1462852, ...}) = 0
mmap2(NULL, 1473032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x456000
mprotect(0x5b7000, 4096, PROT_NONE)     = 0
mmap2(0x5b8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x161) = 0x5b8000
mmap2(0x5bb000, 10760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x5bb000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78c2000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb78c28d0,  limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,   seg_not_present:0, useable:1}) = 0
mprotect(0x5b8000, 8192, PROT_READ)     = 0
mprotect(0x8049000, 4096, PROT_READ)    = 0
mprotect(0xa92000, 4096, PROT_READ)     = 0
munmap(0xb78c3000, 112037)              = 0
exit_group(0)                           = ?

Need some hints to look forward ....

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The creation of processes happens in kernel-space and not user-space, so you will not find code for creating the process-specific things in any of the userspace libraries. (What you can find in the user-space libraries is the .so file loader/runtime linker etc.)

The actual creation of the processes happens within the system call fork() or clone(). This causes the calling processes to be split into two, a parent and a child. The return value of the system call will tell the calling process which one they are. The most common usage is that the child processes after the fork(), performs a exec() system call. This causes the processes program to be replaced with a new executable using the callers resources (filedescriptors, environment, user, group, current-working-directory etc.)

You can see this action if you strace a shell that executes a shell-script.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda