Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 326 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the use of IPC_CREAT | 0666 flag in shmget() function in C

#1


[To see links please register here]


Can someone explain what does the IPC_CREAT |0666 really do in shmget() unix system call in the above code, i know that 0666 is octal value here, but changing it does not have any effect at all.
Reply

#2
0666 is the usual access permision in linux in rwx octal format and having the sequence(owner-group-user). IPC_CREAT has the value of 512 in decimal as defined in the sys/ipc.h header file.

IPC_CREAT|0666 basically performs bitwise or of the two to set the flag in `shmget`, and both of them simply perform their usual functions.
0666 sets the access permissions of the memory segment while
IPC_CREAT tells the system to create a new memory segment for the shared memory.

If this flag is not used then `shmget()` will find the segment associated with key and check to see if the user has permission to access the segment.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through