cis-452-lab-7/assignment.md

1.9 KiB

System Object Method Value Details
Maximum # of semaphores per process static 256 Using POSIX values. Values specified in bits/posix1_lim.h. _POSIX_SEM_NSEMS_MAX
Maximum value of a (counting) semaphore static 32767 Using POSIX values. Values specified in bits/posix1_lim.h. _POSIX_SEM_VALUE_MAX
Maximum value of a (counting) semaphore empirical 32767 Tested in Arch. Did a for loop after getting a semaphore with semget. Used sem init to start at 1, and then added 1 to the semval using semop repeatedly in the for loop. semop failed once it hit 32767, saying “Numerical result out of range”.
Maximum size of a shared memory segment (bytes) empirical 22879482108 Tested in Arch from a PUTTY terminal. Did a for loop with shmget and shmctl in it. Started at 1 and multiplied by 2 each time, passing the value for the iteration into the size parameter of shmget(). Once it failed on that, I looped from the result / 2 to the result, adding 64 mb each time. Once I got a result from that, I looped from 64mb minus the result to the result of the first algorithm. Got values close to the one provided, but within some range.
Page size (bytes) dynamic 4096 Tested in Arch. sysconf(_SC_PAGESIZE)
Physical pages in system dynamic 4109556 Tested in Arch. sysconf(_SC_PHYS_PAGES)
Maximum # of processes per user dynamic 63876 Tested in Arch. sysconf(_SC_CHILD_MAX)
Maximum file size (bytes) dynamic -1 (Unlimited) Tested in Arch. getrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_max;
Maximum # of open files: hard limit dynamic 4096 Tested in Arch. getrlimit(RLIMIT_NOFILE, &rlim); rlim.rlim_max;
Maximum # of open files: soft limit dynamic 1024 Tested in Arch. getrlimit(RLIMIT_NOFILE, &rlim); rlim.rlim_cur;
Clock resolution (msec) dynamic 10 Tested in EOS. sysconf(_SC_CLK_TCK), converted from 100hz to 10ms (1000ms in a second / 100 ticks in a second)