Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linuxÏ´óÎļþ¶ÁдԴÂëʾÀý

#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
int main()
{
printf("sizeof(off_t) = %d\n", sizeof(off_t));
int fd = 0;
#if 1
fd = open("/root/test", O_WRONLY | O_CREAT | O_LARGEFILE, 0600);
#else
fd = open("/dev/hda1", O_RDONLY, 0600);
#endif
if (fd > 0)
{
off_t l = 0x200000001LL;
off_t l_new = lseek(fd, l, SEEK_SET);
if (l_new < 0)
printf("l_new =%d\n", l_new);
#if 1
else
write(fd, &fd, sizeof(fd));
#endif
printf("l_new = 0x%.16x\n", l_new);
close(fd);
}
struct stat st;
int ret = stat( "/root/test", &st);
printf( "\n%d--%I64u-\n", ret, st.st_size );
}


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

Linux repair filesystemÎÊÌâµÄ½â¾ö°ì·¨

    ¹«Ë¾ÓÐ̨ÔËÐÐCentOS5.3µÄµçÄÔ½ñÔçÆô¶¯µÄʱºòÒ»Ö±Ìáʾ#repair filesystem 1ϵͳÎļþË𻵣¬ÐèÒªÐÞ¸´£¬È»¶øʹÓÃfsckÐÞ¸´ÁË°ëÌ컹ÊÇÎÞ·¨½øÈëXWindow¡£ÕâʱÎÒÐèÒªÓÃÓÅÅÌ¿½±´ÀïÃ漸¸öÎļþ£¬Ë÷ÐÔµ½ÃüÁîÐÐshellÖп½±´µÃÁË¡£¿ÉÊǽøÈ¥mountÉ豸µÄʱºòÈ´ÌáʾÎÒ£ºÏµÍ³ÎļþĿ¼ֻ¶Á£¬ÎÞ·¨´´½¨¹Ò½ÓÉ豸Îļþ......Ôõô° ......

linux ²éÕÒÖ´ÐгÌÐòµÄµ±Ç°Â·¾¶

linux shell pwd ÏÔʾµ±Ç°Â·¾¶
¼ÙÈôÓÐtest.cpp
g++ test.cpp -o test
./test
ÏëÔÚtestÖÐÕÒµ½µ±Ç°Ö´ÐгÌÐòËùÔڵķ¾¶
¿ÉÒÔÔÙtest.cppÖÐʹÓÃreadlinkº¯Êý
¾ßÌå¼ûÈçÏÂʵÀý£º
#include<iostream>
#include<unistd.h>
#include<dirent.h>
#include<string.h>
#include<string>
using ......

linuxÏÂIP v6 tcp·þÎñÆ÷¶ËÔ´ÂëʾÀý

/******************************
*
* server.c
*
******************************/
#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<errno.h>
#include<string.h>
#include<netinet/in.h>
#include<sys/wait.h> ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ