简体   繁体   English

Mac OS X 中的 fork()、sleep() 和 pipe(int *fd)

[英]fork(), sleep(), and pipe(int *fd) in Mac OS X

I am taking a class called 'Operating Systems' and we are learning about these functions.我正在使用名为“操作系统”的 class,我们正在学习这些功能。 I have a Mac and i want to know if these function work on Mac, or do I have to install linux.我有一台 Mac,我想知道这些 function 是否可以在 Mac 上运行,或者我是否必须安装 linux。 If I can't do this on Mac, what linux distribution should I install?如果我不能在 Mac 上执行此操作,我应该安装什么 linux 发行版? (There's so many, I don't know which one to get). (有这么多,我不知道该买哪一个)。

Your prototype for pipe() is wrong, but all three functions are part of POSIX.您的pipe()原型是错误的,但所有三个函数都是 POSIX 的一部分。 Since OS X is a POSIX operating system, it supports all three.由于 OS X 是一个 POSIX 操作系统,它支持所有这三个。 Note that you will need to install Apple's developer tools in order to have access to a compiler and the appropriate headers and such in order to build software that uses them.请注意,您需要安装 Apple 的开发人员工具才能访问编译器和适当的头文件等,以便构建使用它们的软件。

I just took Operating Systems, and since the course revolves around UNIX, if you were on Windows, I'd recommend installing Linux just for the sake of the course.我刚学过操作系统,由于课程围绕 UNIX,如果你在 Windows,我建议安装 Linux 只是为了课程。 Since you are on a mac, it shouldn't be too different.由于您使用的是 Mac,因此应该不会有太大的不同。 By the way, most distros have live versions, so you can just boot up Linux for an assignment or something, if you want.顺便说一句,大多数发行版都有实时版本,所以如果你愿意,你可以启动 Linux 来完成任务或其他事情。 Any popular distro would do just fine.任何流行的发行版都可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM