Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This non-compliant code example opens the file specified by the string "/home/rcsuser1/.conf" for read/write exclusive access, and then writes user supplied data to the file.

Code Block
bgColor#FFCCCC
const char* file_name = "/home/rcsuser1/.conf";
if ((fd = open(file_name, O_RDWR)) == -1) {
   /* handle error */
}
write(fd, userbuf, userlen);

...