<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lakshya Kausaliya</title>
    <description>The latest articles on DEV Community by Lakshya Kausaliya (@rao43).</description>
    <link>https://dev.to/rao43</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3810264%2F7f4d91ba-a9c4-4f61-8f2c-5c378c2dfe70.png</url>
      <title>DEV Community: Lakshya Kausaliya</title>
      <link>https://dev.to/rao43</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rao43"/>
    <language>en</language>
    <item>
      <title>"2 ESSENTIAL SYSTEM CALLS EVERY BEGINNER SHOULD KNOW"</title>
      <dc:creator>Lakshya Kausaliya</dc:creator>
      <pubDate>Wed, 08 Apr 2026 13:54:46 +0000</pubDate>
      <link>https://dev.to/rao43/2-essential-system-calls-every-beginner-should-know-2e5l</link>
      <guid>https://dev.to/rao43/2-essential-system-calls-every-beginner-should-know-2e5l</guid>
      <description>&lt;p&gt;&lt;strong&gt;INRODUCTION&lt;/strong&gt;:-&lt;br&gt;
WHAT ARE SYSTEM CALLS?&lt;br&gt;
Basically in simple language they are calls made by the user to interact with the system. They are often used in low level programming as it is meant for interacting with the system.&lt;/p&gt;

&lt;p&gt;WHY THEY EVEN MATTER?&lt;br&gt;
As i have said earlier they are for interacting with the system directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EXPLANATION OF EACH SYSTEM CALL:- **&lt;br&gt;
1]open()=&amp;gt;&lt;br&gt;
It the basic file system call made in every code where we want to interact with the filesystem. Basically it for opening the file.&lt;br&gt;
**Syntax:-&lt;/strong&gt;&lt;br&gt;
open(const char *pathname, int flags) ;&lt;br&gt;
            OR&lt;br&gt;
open(const char *pathname , int flags , mode_t mode);&lt;/p&gt;

&lt;p&gt;pathname → Path to the file&lt;br&gt;
flags → How the file should be opened&lt;br&gt;
mode → Permissions (used when creating a file)&lt;/p&gt;

&lt;p&gt;Actually what's happening internally is when you call open() the operating system changes from user mode to kernel mode and first looks for the file through the path you defined, if the file doesn't exist it shows error and if it exists then it checks for the permission. If the permission for which you applied matches with the permission of the file then it make file description and stores it's entry in OFT(open file table) and it returns the file descriptor(FD) to the program. And now you can access the file using the FD the OS provided.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;:-&lt;br&gt;
int fd = open("file.txt", O_RDONLY);&lt;/p&gt;

&lt;p&gt;It will return  the lowest fd present(which is usually 3 as 0,1,2 are pre occupied)&lt;/p&gt;

&lt;p&gt;2]&lt;strong&gt;read()&lt;/strong&gt;=&amp;gt;&lt;br&gt;
Now we are getting into the flags i have mentioned in the syntax of the open() system call. It is used to read data from file into the buffer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;syntax:-&lt;/strong&gt;&lt;br&gt;
read(int fd, void *buffer, size_t count);&lt;br&gt;
 buffer -&amp;gt; memory location where data is stored&lt;br&gt;
 count-&amp;gt; no. of bytes to read&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;return value:-&lt;/strong&gt;&lt;br&gt;
It generally returns the no. of bytes actually read.&lt;br&gt;
returns 0 -&amp;gt; end of file(EOF)&lt;br&gt;
returns -1 -&amp;gt; error&lt;/p&gt;

&lt;p&gt;char buffer[100];&lt;br&gt;
int bytes = read(fd, buffer, 100);&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
