Ubuntu 12.04...
I had fedora a couple of years back and I saw the man pages for the following there...
unistd.h,
sys/types.h,
standard typedefs (suffixed by "_t") etc.
I tried this...
man unistd
But it didn't find it :(
I think those pages are not…
Fixed
system("read -r -p \"Press any key to continue...\" key")
I am now writing a command line tool and using C language, but I am wondering how to pause the program? (Not abort it, but can be re-continued) I was trying to make it like "Press…
I've inherited source code for a dll file that was originally written for linux. I'm using windows and visual studio and a change to linux is a no can-do, unfortunately. In particular, one of the classes requires unistd.h.
Since windows does not…
I'm writing a batch emulator as a personal project. I'm trying to implement the cd command using chdir() from unistd.h. However, using this causes a segfault.
main.cpp:
#include
#include
#include
#include…
Im trying to use execve() with set variables, but i tried using getenv() and setting HOME at the start and it never works
#include
#include
#include
#include
int main( ){
char *args[] = {…
I'm trying to write test, in which some data should be read from file descriptor, so i'm using dup and pipe functions to check this.
int main()
{
char *line;
int out;
int p[2];
char *str;
int len = 50;
…
I am having trouble reading from stdin constantly until CTRL+D is pressed. I have to use read() from unistd.h. I am trying to simulate the cat function. Is there a way to make my buffer (which I print with %s) to look neat without the unnecessary…
I am having error with my code below
#include
#include
#include
int main()
{
int i, status;
pid_t child;
child=fork();
if(child == 0){
for(i=0; i<10; i++){
…
I've been coding some simple things such as printing statements but I wanted to have my processor sleeping to not have too many printing statements at the same time.
I've used the library unistd.h and used the function sleep().
The problem I have…
So I have this project where I need to open a file and print the contents in C, but I have to use unix system calls. However I'm not to clear as to why nothing prints. I try to run the code, but it seems to skip straight to the close error. I'm…