소스 수정및 추가 부탁드립니다..
겨라
리눅스에서현재까지 실행된 프로세스를 출력하려면터미널에서 ps -A -o pid,euser,time,comm을 입력하면PID EUSER TIME COMMAND 1 root 00:00:00 init 2 root 00:00:00 kthreadd 3 root 00:00:00 migration/0 4 root 00:00:00 ksoftirqd/0 5 root 00:00:00 watchdog/0 6 root 00:00:00 events/0...이런식으로 나오지 않습니까??암튼 그렇다 칩시다..근데 이걸 c언어로 구현하고자 하는데..제가 헷갈리는 부분은..빨간글씨 참고...#include stdio.h#include stdlib.hstruct info{int pid;char euser[64];int time;char comm[256];};int main(int argc, char *argv[]){int i; /* Declares a string buffer of 256 characters. */char buffer[256]; struct info psinfo[1024];// Reading and parsing the piped-in text.while (조건..을 무엇을 넣어야 할지..buffer !=NULL 은 프로그램이 계속...되서 아닌거같고..){/* Reads 256 characters or until newline character from standard input.*/ fgets(buffer,256,stdin);// Break up (parse) buffer into 4 components.pid 번호 사용자 시간 command 네부분..나누기//strtok함수를쓸수있는지...// psinfo array에 토큰을 어떻게 저장해야하는지...}// Checks number of input arguments (argc).if (argc==1){// Just print the lines again.printf(%s, buffer);}else if (argc1){//Compare the euser in argv[1] to euser in each struct.if (argc==3){// Check argv[2]. Requirement 2if (strcmp(argv[2],time)==0){// 시간순서에 대하여 출력은...어떻게..무슨함수를 써야되는지..}// Requirement 3else if (strcmp(argv[2],comm)==0){//시간조건만알면 제가할수있을거 같습니다만..ㅠㅠ}}}}빨간 글씨쓴 부분좀 알려주세요..ㅠㅠ