为什么/ dev / stdout是“1 [重复]

问题描述 投票:0回答:1

这个问题在这里已有答案:

SEGMENT .data ; nothing here
SEGMENT .text ; sauce
global _start
_start:
            pop ECX ; get ARGC value
            mov EAX, 4 ; sys_write()
            mov EBX, 1 ; /dev/stdout
           ;^^^^^^^^^^^
            mov EDX, 1 ; a single byte
            int 0x80
            mov EAX, 1 ; sys_exit()
                    mov EBX, 0 ; return 0
            int 0x80
SEGMENT .bss ; nothing here

为什么mov EBX,“”1“”; / dev / stdout?哪个文件我能找到“1”?

linux gcc
1个回答
-1
投票

在unix系统上,进程通常有3个连接到它的公共I / O通道,称为stdin / stdout / stderr。它们具有相应的文件描述符值0,1和2。

记录在:http://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html(另见wikipedia page

© www.soinside.com 2019 - 2024. All rights reserved.