CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - unistd.h
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - unistd.h - List
[
Internet-Network
]
linux_c_s
DL : 0
基于终端的订花系统_socket #include<stdio.h> #include<stdlib.h> #include<errno.h> #include<string.h> #include<sys/types.h> #include<netinet/in.h> #include<sys/socket.h> #include<sys/wait.h> #include<sys/ipc.h> #include<unistd.h> #include<sys/shm.h> #include<sys/stat.h> #define MYPORT 3490 // num of port #define BACKLOG 5 // largest num of accept #define MAXDATASIZE 1-based terminal Dinghua system _socket # include
Date
: 2008-10-13
Size
: 3.84kb
User
:
xxf
[
Other
]
4
DL : 0
学会对文件的记录锁定,及解锁。#include <stdio.h> #include <unistd.h> #include <fcntl.h> int main() { int fd int i struct { char name[20] uint ID int age } myrec fd =open(\"name\", O_RDWR|O_CREAT, 0755) if (fd == -1) return -1 printf(\"Input your name:\") scanf(\"%s\", myrec.name) printf(\"Inpute your ID :\") scanf(\"%d\", &myrec.ID) printf(\"Input your age :\") scanf(\"%d\", &myrec.age) lseek(fd, 0,SEEK_END) lockf(fd, 1, 0) write(fd, (void *)&myrec, sizeof(myrec)) lockf(fd, 0 ,0) return 0 } 执行命令cc lock.c –o lock.out Chmod +x lock.out ./lock.out
Date
: 2008-10-13
Size
: 9.08kb
User
:
华羿
[
Linux-Unix
]
LinuxUART
DL : 0
linux 下串口编程 #include <stdio.h> /*标准输入输出定义*/ #include <stdlib.h> /*标准函数库定义*/ #include <unistd.h> /*Unix标准函数定义*/ #include <sys/types.h> /**/ #include <sys/stat.h> /**/ #include <fcntl.h> /*文件控制定义*/ #include <termios.h> /*PPSIX终端控制定义*/ #include <errno.h> /*错误号定义*/ /***@brief 设置串口通信速率 *@param fd 类型 int 打开串口的文件句柄 *@param speed 类型 int 串口速度 *@return void*/
Date
: 2008-10-13
Size
: 5.17kb
User
:
Edward
[
Internet-Network
]
linux_c_s
DL : 0
基于终端的订花系统_socket #include<stdio.h> #include<stdlib.h> #include<errno.h> #include<string.h> #include<sys/types.h> #include<netinet/in.h> #include<sys/socket.h> #include<sys/wait.h> #include<sys/ipc.h> #include<unistd.h> #include<sys/shm.h> #include<sys/stat.h> #define MYPORT 3490 // num of port #define BACKLOG 5 // largest num of accept #define MAXDATASIZE 1-based terminal Dinghua system _socket# include
Date
: 2025-07-16
Size
: 4kb
User
:
xxf
[
Other
]
4
DL : 0
学会对文件的记录锁定,及解锁。#include <stdio.h> #include <unistd.h> #include <fcntl.h> int main() { int fd int i struct { char name[20] uint ID int age } myrec fd =open("name", O_RDWR|O_CREAT, 0755) if (fd == -1) return -1 printf("Input your name:") scanf("%s", myrec.name) printf("Inpute your ID :") scanf("%d", &myrec.ID) printf("Input your age :") scanf("%d", &myrec.age) lseek(fd, 0,SEEK_END) lockf(fd, 1, 0) write(fd, (void *)&myrec, sizeof(myrec)) lockf(fd, 0 ,0) return 0 } 执行命令cc lock.c –o lock.out Chmod +x lock.out ./lock.out
Date
: 2025-07-16
Size
: 9kb
User
:
华羿
[
Linux-Unix
]
LinuxUART
DL : 0
linux 下串口编程 #include <stdio.h> /*标准输入输出定义*/ #include <stdlib.h> /*标准函数库定义*/ #include <unistd.h> /*Unix标准函数定义*/ #include <sys/types.h> /**/ #include <sys/stat.h> /**/ #include <fcntl.h> /*文件控制定义*/ #include <termios.h> /*PPSIX终端控制定义*/ #include <errno.h> /*错误号定义*/ /***@brief 设置串口通信速率 *@param fd 类型 int 打开串口的文件句柄 *@param speed 类型 int 串口速度 *@return void*/ -linux serial port programming under# include
Date
: 2025-07-16
Size
: 5kb
User
:
Edward
[
Linux-Unix
]
shell
DL : 0
#include<stdio.h> #include<string.h> #include<limits.h> #include<unistd.h> #include<sys/types.h> #define PROMPT_STRING "[myshell]$" #define QUIT_STRING "exit\n" static char inbuf[MAX_CANON] char * g_ptr char * g_lim extern void yylex() int main (void){ for( ){ if(fputs(PROMPT_STRING,stdout)==EOF) continue if(fgets(inbuf,MAX_CANON,stdin)==NULL) continue if(strcmp(inbuf,QUIT_STRING)==0) break g_ptr = inbuf g_lim = inbuf + strlen(inbuf) yylex() } return 0 } -# Include <stdio.h># Include <string.h># Include <limits.h># Include <unistd.h># Include <sys/types.h># Define PROMPT_STRING [myshell] $ # define QUIT_STRING exit static char inbuf [MAX_CANON] char* g_ptr char* g_lim extern void yylex () int main (void) (for () (if (fputs (PROMPT_STRING, stdout) == EOF) continue if (fgets (inbuf, MAX_CANON, stdin) == NULL) continue if (strcmp (inbuf, QUIT_STRING) == 0) break g_ptr = inbuf g_lim = inbuf+ strlen (inbuf) yylex ()) return 0)
Date
: 2025-07-16
Size
: 32kb
User
:
李明
[
Linux-Unix
]
framebuffer
DL : 0
帧缓冲#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <asm/page.h> #include <linux/fb.h> #define TRUE 1 #define FALSE 2 //a framebuffer device structure typedef struct fbdev{ int fb unsigned long fb_mem_offset unsigned long fb_mem struct fb_fix_screeninfo fb_fix -Frame buffer# Include <stdio.h># Include <stdlib.h># Include <string.h># Include <stdint.h># Include <unistd.h># Include <fcntl.h># include <sys/ioctl.h># include <sys/mman.h># include <asm/page.h># include <linux/fb.h># define TRUE 1# define FALSE 2// a framebuffer device structure typedef struct fbdev (int fb unsigned long fb_mem_offset unsigned long fb_mem struct fb_fix_screeninfo fb_fix
Date
: 2025-07-16
Size
: 1kb
User
:
hjintian
[
Communication-Mobile
]
serial
DL : 0
include <stdio.h> /*标准输入输出定义*/ #include <stdlib.h> /*标准函数库定义*/ #include <unistd.h> /*Unix标准函数定义*/ #include <sys/types.h> /**/ #include <sys/stat.h> /**/ #include <fcntl.h> /*文件控制定义*/ #include <termios.h> /*PPSIX终端控制定义*/ #include <errno.h> /*错误号定义*/ #define TRUE 1 #define FALSE 0 /***@brief 设置串口通信速率 *@-include <stdio.h>/* Standard input and output definitions* /# include <stdlib.h>/* Standard function library definition* /# include <unistd.h>/* Unix standard function definition* /# include <sys/types.h>/** /# Include <sys/stat.h>/** /# Include <fcntl.h>/* File control definition* /# include <termios.h>/* PPSIX terminal control definitions* /# include <errno.h>/* Error number definitions* /# define TRUE 1# define FALSE 0 /***brief set of serial communication rate* @
Date
: 2025-07-16
Size
: 9kb
User
:
nameblue
[
Applications
]
client_serveur
DL : 0
client socket include <sys/types.h> include <sys/socket.h> include <stdio.h> include <netinet/in.h> include <arpa/inet.h> include <unistd.h> int main() { int sockfd int len struct sockaddr_in address int result char ch = A sockfd = socket(AF_INET, SOCK_STREAM, 0) address.sin_family = AF_INET address.sin_addr.s_addr = inet_addr("127.0.0.1") address.sin_port = 9734 len = sizeof(address) result = connect(sockfd, (struct sockaddr *)&address, len) if(result == -1) { perror("oops: client") exit(1) } write(sockfd, &ch, 1) read(sockfd, &ch, 1) printf("char from server = c\n", ch) close(sockfd) exit(0) } -client socket include <sys/types.h> include <sys/socket.h> include <stdio.h> include <netinet/in.h> include <arpa/inet.h> include <unistd.h> int main() { int sockfd int len struct sockaddr_in address int result char ch = A sockfd = socket(AF_INET, SOCK_STREAM, 0) address.sin_family = AF_INET address.sin_addr.s_addr = inet_addr("127.0.0.1") address.sin_port = 9734 len = sizeof(address) result = connect(sockfd, (struct sockaddr*)&address, len) if(result ==-1) { perror("oops: client") exit(1) } write(sockfd, &ch, 1) read(sockfd, &ch, 1) printf("char from server = c\n", ch) close(sockfd) exit(0) }
Date
: 2025-07-16
Size
: 1kb
User
:
nabilnapel
[
Books
]
malloc
DL : 0
针对由系统调用sbrk()申请得到的内存区域进行管理,实现了用户中申请、释放内存过程。整个程序由头文件malloc.h、分配与释放模块malloc.c、应用程序test.c和工程文件makefile共四个文件组成,该程序已在linux下成功调试通过-include <unistd.h> #include "my_malloc.h" static Header base /* empty list to get started*/ static Header*free_list = NULL /* start of free list*/ /* Malloc: general-purpose storage allocator*/ void* Malloc(unsigned int nbytes) { Header*p,*prev unsigned int nunits nunits = (nbytes+ sizeof(Header)- 1)/sizeof(Header)+ 1 if ( (prev = free_list) == NULL) { /* no free list yet*/
Date
: 2025-07-16
Size
: 9kb
User
:
jjl
[
Embeded Linux
]
watchdog
DL : 0
watchdog 这是一个例程!可以参考一下!-#include <errno.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <sys/io.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h>
Date
: 2025-07-16
Size
: 1kb
User
:
占
[
Sniffer Package capture
]
firm
DL : 0
Bluetooth xfu flash #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <unistd.h> #include <fcntl.h> #include <err.h> #include <string.h> #include <assert.h> #include <stdarg.h> #include "dfu.h"
Date
: 2025-07-16
Size
: 5kb
User
:
ulego
[
Software Engineering
]
processfunctions
DL : 0
C++ 进程函数实例。<unistd.h>头文件功能函数相关解析。-C++ examples of the process of a function. <unistd.h> Header file utility functions related to parsing.
Date
: 2025-07-16
Size
: 2kb
User
:
方林
[
Process-Thread
]
threadfunctions
DL : 0
visual c++ 线程函数实例; <unistd.h>头文件相关函数功能说明。-visual c++ thread example of a function <unistd.h> Function Description header file related functions.
Date
: 2025-07-16
Size
: 2kb
User
:
方林
[
Compress-Decompress algrithms
]
zlib-1.2.3
DL : 0
Zlib压缩算法,可在BCB下和VC下使用,附dll工程,直接用VC可编译成dll,可在其它开发环境下使用-Zlib compression algorithm can be under BCB and VC to use, with a dll project, the direct use of VC can be compiled into a dll, can be used in other development environments
Date
: 2025-07-16
Size
: 553kb
User
:
daily
[
Linux-Unix
]
portscan
DL : 0
Linux下的端口扫描实现 f (!connect(sockfd,(struct sockaddr*)&server,sizeof(struct sockaddr- #include<stdlib.h> #include<stdio.h> #include<sys/socket.h> #include<netdb.h> #include<string.h> #include<unistd.h> #include<netinet/in.h> #include<arpa/inet.h>
Date
: 2025-07-16
Size
: 1kb
User
:
david
[
Internet-Network
]
HTTP
DL : 0
HTTP协议的C语言编程实现实例 HTTP协议的C语言编程实现实例 HTTP协议的C语言编程实现实例-#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include <unistd.h> #include <netinet/in.h> #include <limits.h> #include <netdb.h> #include <arpa/inet.h> #include <ctype.h>
Date
: 2025-07-16
Size
: 3kb
User
:
zyh
[
Linux-Unix
]
Linux-serial
DL : 0
Linux 系统串口使用代码 /* * Program: serial.c * Author: Paul Dean * Version: 0.0.3 * Date: 2002-02-19 * Description: To provide underlying serial port function, * for high level applications. * */ #include <termios.h> /* tcgetattr, tcsetattr */ #include <stdio.h> /* perror, printf, puts, fprintf, fputs */ #include <unistd.h> /* read, write, close */ #include <fcntl.h> /* open */ #include <sys/signal.h> #include <sys/types.h> #include <string.h> /* bzero, memcpy */ #include <limits.h> /* CHAR_MAX */ #include "vardef.h" /* INT32, INT16, INT8, UINT32, UINT16, UINT8 */ #include "serial.h"-This directory contains the version 0.0.4 release of the Serial Debugger (SDB). The SDB is free software. If you think it is useful in your applications or solutions, you are admitted to use this source code with the declaration of Copyright to the original author, now Ding Baohua. Install procedure is referred to INSTALL file.
Date
: 2025-07-16
Size
: 8kb
User
:
zhangxiaojun
[
Linux-Unix
]
unistd
DL : 0
this the header file for using socket communication conccepts in unistd.h unistd.h header file is used for tyhe communication maachines-this is the header file for using socket communication conccepts in unistd.h unistd.h header file is used for tyhe communication maachines..
Date
: 2025-07-16
Size
: 1kb
User
:
rajv
«
1
2
»
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.