Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:33 UTC Jan Schaumann Jan Schaumann

    Advanced #Programming in the #UNIX Environment

    Week 1, Unix Basics

    We write our first trivial program, which promptly segfaults and gives us a chance to explain function forward declarations and maneuvering man pages and set our default compiler flags ("-Wall -Werror -Wextra"), then proceed to write the most trivial versions of ls(1), cat(1), and even a rudimentary shell.

    https://youtu.be/w3spRzZ8bSA

    Slides: https://stevens.netmeister.org/631/01-basics.pdf

    #apue

    In conversation about 7 months ago from mstdn.social permalink

    Attachments


    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:32 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 2, File Descriptors

      What is a file descriptor? We run through a code example to determine the maximum number of file descriptors a process can have open. Sounds simple enough, right? In the process, we look at compile-time defined constants, system-wide configuration parameters, look at the source for getconf(1), hit on rlimits, and confirm experimentally what the actual value is on #NetBSD, #Linux, and #macOS

      https://youtu.be/h5A1OQjuCqk

      #apue

      In conversation about 7 months ago permalink

      Attachments

      1. Advanced Programming in the UNIX Environment: Week 02, Segment 1 - File Descriptors
        from cs631apue
        In this video segment, we'll run through a code example to determine the maximum number of file descriptors a unix process can have open. Sound simple enough...
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:33 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 3, chmod(2) and chown(2)

      Having seen a lot of examples in our previous videos of creating files, changing their ownership and permissions, we now focus on the system calls that are used to implement the chmod(1) and chown(8) commands. (As always, note the different manual sections, which hint at their intended use.)

      https://youtu.be/5MJmCanZDyk

      #apue

      In conversation about 7 months ago permalink

      Attachments

      1. Advanced Programming in the UNIX Environment: Week 03, Segment 4 - chmod(2) and chown(2)
        from cs631apue
        Having seen a lot of examples in our previous videos of creating files, changing their ownership, changing their permissions, we now focus on the system call...
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:34 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 3, struct stat st_mode

      In this short segment, we're looking at how the traditional permissions defined in the struct stat st_mode are applied. (We'll get to ACLs a bit later in the semester.) The order in which owner, group, and other permissions are evaluated explains why a file owner can write, but cannot read a file with permission 244, or that root can (of course) read a file despite permissions 000.

      https://youtu.be/vS6abFjN3ZY

      #apue

      In conversation about 7 months ago permalink
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:35 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 3, UIDs and GIDs

      We learn a little bit more about file ownership and the user IDs of a process by looking at the seteuid(2) and setuid(2) system calls and experimenting with setting the setuid bits and observe the file access we gain. Examples include, of course, ping(8) (we're not using e.g., capabilities here), traceroute(8), or even something as simple as wall(1) or write(1).

      https://youtu.be/YlcF3ncTQpo

      #apue

      In conversation about 7 months ago permalink
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:36 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 3, stat(2) intro

      We meet our new best friend, the "struct stat"! We cover the stat(2) system calls (stat(2), lstat(2), fstat(2)) and begin discussing each of the fields in the struct, often by example of the ls(1) and stat(1) commands. In this way, we begin learning more about how the Unix File System is implemented.

      The video also shows how to add a new disk to our #NetBSD VM in VirtualBox.

      https://youtu.be/veFwXrEHPsk

      #apue

      In conversation about 7 months ago permalink
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:37 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 2, File Sharing

      In this final video lecture segment for our week 2 materials, we take a look at the kernel structures used to implement the basic I/O syscalls and discuss the impact of multiple, simultaneous processes accessing the same files. We conclude with a look at /dev/fd on #NetBSD, #macOS, and #Linux.

      https://youtu.be/CAbUtc86ULw

      #apue

      In conversation about 7 months ago permalink
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:38 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 2, basic I/O with file descriptors: open(2) and close(2)

      We see what happens when we try to create a file, "create" an existing file, open an existing file, truncate a file, and look at the various other flags we can pass. We also note the perhaps surprising number of ways in which open(2) can fail and take a look at openat(2) and TOCTOU defenses.

      https://youtu.be/QnL4eYpb5Iw

      #apue

      In conversation about 7 months ago permalink
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:38 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      Week 2, read(2), write(2), and lseek(2)

      We will look at these basic I/O syscalls and do a few weird things with file descriptors, like seek past the end of the file, creating a sparse file in the process. We'll also take a look at I/O efficiency when making these system calls and find out that simply increasing the read buffer isn't going to work beyond a certain point.

      https://youtu.be/EUUPw8MOV_A

      #apue

      In conversation about 7 months ago permalink
    • Jan Schaumann (jschauma@mstdn.social)'s status on Tuesday, 26-Nov-2024 15:58:39 UTC Jan Schaumann Jan Schaumann
      in reply to

      Advanced #Programming in the #UNIX Environment

      A nice bit of Unix history:

      "A Research UNIX Reader: Annotated Excerpts from the Programmer’s Manual, 1971-1986" by M. Douglas McIlroy

      https://www.cs.dartmouth.edu/~doug/reader.pdf

      #apue

      In conversation about 7 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.