原创 brk(),sbrk(),malloc(),calloc()

copy from http://blog.csdn.net/clearriver/article/details/5423251 brk和sbrk主要的工作是實現虛擬內存到內存的映射.在GNUC中,內存分配是這樣的:        每

原创 linux stat函數講解

stat函數講解 表頭文件:    #include <sys/stat.h>              #include <unistd.h> 定義函數:    int stat(const char *file_name, struc

原创 有效用戶ID 實際用戶ID

copy from 點擊打開鏈接 第9位表示文件類型,可以爲p、d、l、s、c、b和-: p表示命名管道文件  d表示目錄文件  l表示符號連接文件  -表示普通文件  s表示socket文件  c表示字符設備文件  b表示塊設備文

原创 458 - The Decoder

 The Decoder  Write a complete program that will correctly decode a set ofcharacters into a valid message. Your progr

原创 進程出隊

#include <malloc.h> #include <stdio.h> #include <string.h> typedef struct processpcb { int id; /*??*/ struct proc

原创 進程調度—時間片輪轉

#include <malloc.h> #include <stdio.h> #include <string.h> typedef struct table { int key; /*進程ID號*/ in

原创 進程調度—先來先服務

#include <malloc.h> #include <stdio.h> #include <string.h> typedef struct table { int key; /*進程ID號*/ int sequenc

原创 dup()以及dup2()函數介紹

dup和dup2也是兩個非常有用的調用,它們的作用都是用來複制一個文件的描述符。它們經常用來重定向進程的stdin、stdout和stderr。這兩

原创 C 文件流

copy from http://blog.sina.com.cn/s/blog_6778368b0100vidz.html 1      C文件操作 在ANSI C中,對文件的操作分爲兩種方式,即: ü  流式文件操作 ü I/O文件

原创 10300 Ecological Premium

Problem A Ecological Premium Input: standard input Output: standard output Time Limit: 1 second Memory Limit: 32 MB Ge

原创 進程調度—最大優先數

#include <malloc.h> #include <stdio.h> #include <string.h> typedef struct table { int key; /*進程ID號*/ int priorit

原创 Linux筆記 find和grep命令

find命令用於搜索文件。其完整語法爲:find [path] [options] [tests] [actions] path是要搜索的路徑,可以是絕對路徑也可以是相對路徑。 options有許多選項可用,以下列出一些主要的選項    

原创 進程入隊

#include <malloc.h> #include <stdio.h> #include <string.h> typedef struct processpcb { int id; /*進程控制塊編號*/ struct

原创 Linux程序設計筆記 第一章

嚴格來說,UNIX是由OpenGroup(開放組織)管理的一個商標,它指的是一種遵循特定規範的計算機操作系統。這個規範也成爲單一UNIX規範(TheSingle UNIXSpecitication),它定義了所有必須的UNIX操作系統

原创 勇士Hashmat 100055

Problem A Hashmat the brave warrior Input: standard input Output: standard output   Hashmat is a brave warrior who wit