Skip to content

Commit d8238da

Browse files
authored
Update nodejs-binary.md
1 parent 503ab8d commit d8238da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/blog/2021/05/11/nodejs-binary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you are using UNIX-like operating system, you can easily check content of any
1717
0000004
1818
```
1919

20-
In linux executable file is executed by kernel and format of executable is determinated using either magic numbers or file extension. Built-in module _binfmt_ is responsible for this process. In linux 5.9 you can find <a href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs?h=linux-5.9.y" target="_blank">seven</a> file formats that kernel supports out of box (take a look onto files with prefix `binfmt` there in the list). And, surprisingly, one of the format is shebang scripts — scripts, that start with `#!` symbol combination. Thus, if you run, using your favorite shell program, script, which has permission to be executed, kernel will decide what to do with your script.
20+
In linux executable file is executed by kernel and format of executable is determinated using either magic numbers or file extension. Built-in module _binfmt_ is responsible for this process. In linux 5.9 you can find <a href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs?h=linux-5.9.y" target="_blank">seven</a> file formats that kernel supports out of box (take a look at the files with prefix `binfmt` in the list there). And, surprisingly, one of the format is shebang scripts — scripts, that start with `#!` symbol combination. Thus, if you run, using your favorite shell program, script, which has permission to be executed, kernel will decide what to do with your script.
2121

2222
But the most interesting part of this mechanism that you can easily extend itusing <a href="https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html" target="_blank">custom binary formats</a>. By default, your distribution has mounted folder `binfmt_misc` in `/proc/sys/fs`:
2323

0 commit comments

Comments
 (0)