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 ÄÚºËÖÐµÄ GCC ÌØÐÔ(ת£©
Á˽âÓÃÓÚ C ÓïÑ﵀ GCC À©Õ¹
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt=&qu ......
ÓɲÙ×÷ϵͳʵÏÖµÄËùÓÐϵͳµ÷ÓÃËù¹¹³ÉµÄ¼¯ºÏ¼´³ÌÐò½Ó¿Ú»òÓ¦Óñà³Ì½Ó¿Ú(Application Programming Interface£¬API)¡£ÊÇÓ¦ÓóÌÐòͬϵͳ֮¼äµÄ½Ó¿Ú¡£
¡¡¡¡²Ù×÷ϵͳµÄÖ÷Òª¹¦ÄÜÊÇΪӦÓóÌÐòµÄÔËÐд´½¨Á¼ºÃµÄ»·¾³£¬ÎªÁË´ïµ½Õâ¸öÄ¿µÄ£¬ÄÚºËÌṩһϵÁо߱¸Ô¤¶¨¹¦ÄܵĵÄÄں˺¯Êý£¬Í¨¹ýÒ»×é³ÆΪϵͳµ÷Óõģ¨system call)µÄ½Ó¿Ú³ÊÏÖ¸øÓà ......
°²×°ÊµÀý£ºImageMagickµÄ°²×°·½·¨
ImageMagickµÄ°²×°·½·¨ÓÐRPM·½Ê½ºÍSOURCE·½Ê½¡£Ä¿Ç°×îаæÊÇImageMagick-6.5.5¡£¿ÉÒÔ´ÓÕâ¸öÍøÖ·ÏÂÔØ£º http://www.imagemagick.org
°²×°²½Ö裺
£±£®sshÁ¬½ÓLinux·þÎñÆ÷
£²£®°ÑÏÂÔصݲװÎļþ·Åµ½Êʵ±µÄÎļþ¼ÐÏ¡£ÀýÈ磺cd /usr/local/src¡£»òÕßÖ±½ÓÔÚ·þÎñÆ÷ÉÏÏÂÔØ¡£
3£®½âѹÏÂÔØÎļ ......