system-calls

    0热度

    2回答

    我在我的程序中执行一些物理计算,其中输出需要存储到临时缓冲区并通过管道。 缓冲区需要共享不同的数据类型:首先,我需要存储我研究这一课题的名称;其次是我的计算结果(全部为float数字)。 的代码看起来是这样的: initialdata.dat Aston Martin Vantage V12|07.7|090 Ferrari LaFerrari |09.6|111 Lamborghini A

    0热度

    2回答

    在UML状态机中状态之间的转换中,您可以具有触发器,警戒和效果。 如果我进行阻塞系统调用(例如,在Posix系统上选择()或在Raspberry Pi上执行wait_for_edge()),这是一个呼叫事件,因为状态机被阻塞,我无法继续进行此操作? 我可以用这种方式建模这个状态机吗还是必须使用不同的机制? 感谢

    -2热度

    2回答

    我试图从exit()systemcall打印出返回码。但是由于程序退出,它没有机会打印出将被杀死的东西。我的问题是,如何在程序中打印返回代码。 y = syscall(NR_mycall); //makes an exit in this second printf("%s\n", strerror(y)); 正如预期的那样没有输出! :U(

    0热度

    1回答

    我必须制作简单的shell来读取命令并按顺序执行它们。条件不改变主函数的形式,并且执行函数应该是递归的。 主要问题是,它似乎waitpid不起作用。但我知道,我的代码中存在很多问题。请让我知道我应该从哪里开始.. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <

    -1热度

    1回答

    我想遍历所有可能的进程ID,但为此,我需要知道进程表的限制。我怎样才能找到这个? 我的想法是做类似 while (counter < table size) { do something }

    1热度

    1回答

    我有以下几点: /* execute_py.c */ #include <stdio.h> #include <stdlib.h> #include "postgres.h" #include "fmgr.h" #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif int call_py() { printf("Execu

    0热度

    2回答

    我想知道,如果一个文件是目录或统计常规文件: #define _DEFAULT_SOURCE #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int is_regular_file(const char *path) { struct stat path_stat; stat(pat

    2热度

    1回答

    在linux下可以使用系统调用号4打印的东西: mov eax,4 ;system call number mov ebx,0 ;file descriptor mov ecx,msg ;adress of message in data segment mov edx,length ;length of message 但是,你如何打印从堆栈段的东西吗? 我尝试这样做: push

    1热度

    1回答

    我得到macOS的场景,我不能关闭内存映射文件没有 解除它首先(使用munmap syscall),虽然关闭系统调用返回成功结果(= 0)我仍然可以在lsof -n中看到文件记录。 在linux中,它明确提到,closing the file doesn't unmap the file,根据MMAP手册页。 是它确实是2和操作系统之间的不同的行为? 对这种不同的行为有任何解释吗? 编辑:阅读下面

    0热度

    1回答

    /*我想这样做,但它是无效的。 所以任何帮助将不胜感激。 */ #include <cstdlib> #include <iostream> #include <string> using namespace std; int main() { string name = "Karma"; string greet = "How was your day?";