亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? syslinux.c

?? 這是Linux環(huán)境下的bootsyslinux-1.31版本
?? C
字號:
#ident "$Id: syslinux.c,v 1.5 1998/02/04 09:27:56 hpa Exp $"/* ----------------------------------------------------------------------- * *    *   Copyright 1998 H. Peter Anvin - All Rights Reserved * *   This program is free software; you can redistribute it and/or modify *   it under the terms of the GNU General Public License as published by *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, *   USA; either version 2 of the License, or (at your option) any later *   version; incorporated herein by reference. * * ----------------------------------------------------------------------- *//* * syslinux.c - Linux installer program for SYSLINUX * * This program ought to be portable.  I hope so, at least. * * HPA note: this program needs too much privilege.  We should probably * access the filesystem directly like mtools does so we don't have to * mount the disk.  Either that or if Linux gets an fmount() system call * we probably could do the mounting ourselves, and make this program * setuid safe. * * Also, sync() between accessing the raw device and mount/umount seems * to be necessary; I get data corruption otherwise. */#include <alloca.h>#include <errno.h>#include <fcntl.h>#include <mntent.h>#include <paths.h>#include <stdio.h>#include <string.h>#include <unistd.h>#include <sys/stat.h>#include <sys/types.h>#include <sys/wait.h>#ifndef _PATH_MOUNT#define _PATH_MOUNT "/bin/mount"#endif#ifndef _PATH_UMOUNT#define _PATH_UMOUNT "/bin/umount"#endifextern unsigned char bootsect[];extern unsigned int  bootsect_len;extern unsigned char ldlinux[];extern unsigned int  ldlinux_len;char *program;			/* Name of program */char *device;			/* Device to install to */uid_t euid;			/* Our current euid */enum bs_offsets {  bsJump          = 0x00,  bsOemName       = 0x03,  bsBytesPerSec   = 0x0b,  bsSecPerClust   = 0x0d,  bsResSectors    = 0x0e,  bsFATs          = 0x10,  bsRootDirEnts   = 0x11,  bsSectors       = 0x13,  bsMedia         = 0x15,  bsFATsecs       = 0x16,  bsSecPerTrack   = 0x18,  bsHeads         = 0x1a,  bsHiddenSecs    = 0x1c,  bsHugeSectors   = 0x20,  bsDriveNumber   = 0x24,  bsReserved1     = 0x25,  bsBootSignature = 0x26,  bsVolumeID      = 0x27,  bsVolumeLabel   = 0x2b,  bsFileSysType   = 0x36,  bsCode          = 0x3e,  bsSignature     = 0x1fe};#define bsCopyStart bsBytesPerSec#define bsCopyLen   (bsCode-bsBytesPerSec)/* * Access functions for littleendian numbers, possibly misaligned. */static u_int16_t get_16(unsigned char *p){  return (u_int16_t)p[0] + ((u_int16_t)p[1] << 8);}static u_int32_t get_32(unsigned char *p){  return (u_int32_t)p[0] + ((u_int32_t)p[1] << 8) +    ((u_int32_t)p[2] << 16) + ((u_int32_t)p[3] << 24);}int main(int argc, char *argv[]){  static unsigned char sectbuf[512];  unsigned char *dp;  const unsigned char *cdp;  int dev_fd, fd;  struct stat st;  int nb, left, veryold;  unsigned int sectors, clusters;  int err = 0;  pid_t f, w;  int status;  char *mntpath = NULL, mntname[64];  char *ldlinux_name;  int my_umask;  program = argv[0];  if ( argc != 2 || argv[1][0] == '-' ) {    fprintf(stderr, "Usage: %s device\n", program);    exit(1);  }  device = argv[1];  /*   * First make sure we can open the device at all, and that we have   * read/write permission.   */  dev_fd = open(device, O_RDWR);  if ( dev_fd < 0 || fstat(dev_fd, &st) < 0 ) {    perror(device);    exit(1);  }  if ( !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode) ) {    fprintf(stderr, "%s: not a block device or regular file\n", device);    exit(1);  }  left = 512;  dp = sectbuf;  while ( left ) {    nb = read(dev_fd, dp, left);    if ( nb == -1 && errno == EINTR )      continue;    if ( nb < 0 ) {      perror(device);      exit(1);    } else if ( nb == 0 ) {      fprintf(stderr, "%s: no boot sector\n", device);      exit(1);    }    dp += nb;    left -= nb;  }  close(dev_fd);  sync();    /*   * Check to see that what we got was indeed an MS-DOS boot sector/superblock   */  if ( sectbuf[bsBootSignature] == 0x29 ) {    /* It's DOS, and it has all the new nice fields */    veryold = 0;    sectors = get_16(sectbuf+bsSectors);    sectors = sectors ? sectors : get_32(sectbuf+bsHugeSectors);    clusters = sectors / sectbuf[bsSecPerClust];    if ( !memcmp(sectbuf+bsFileSysType, "FAT12   ", 8) ) {      if ( clusters > 4086 ) {	fprintf(stderr, "%s: ERROR: FAT12 but claims more than 4086 clusters\n",		device);	exit(1);      }    } else {      fprintf(stderr, "%s: filesystem type \"%8.8s\" not supported\n",	      device, sectbuf+bsFileSysType);      exit(1);    }  } else {    veryold = 1;    if ( sectbuf[bsSecPerClust] & (sectbuf[bsSecPerClust] - 1) ||	 sectbuf[bsSecPerClust] == 0 ) {      fprintf(stderr, "%s: This doesn't look like a FAT filesystem\n",	      device);    }    sectors = get_16(sectbuf+bsSectors);    sectors = sectors ? sectors : get_32(sectbuf+bsHugeSectors);    clusters = sectors / sectbuf[bsSecPerClust];        if ( clusters > 4086 ) {      fprintf(stderr, "%s: Only FAT12 filesystems supported\n", device);      exit(1);    }  }  if ( get_16(sectbuf+bsBytesPerSec) != 512 ) {    fprintf(stderr, "%s: Sector sizes other than 512 not supported\n",	    device);    exit(1);  }  if ( sectbuf[bsSecPerClust] > 32 ) {    fprintf(stderr, "%s: Cluster sizes larger than 16K not supported\n",	    device);  }  /*   * Now mount the device.  If we are non-root we need to find an fstab   * entry for this device which has the user flag and the appropriate   * options set.   */  if ( (euid = geteuid()) ) {    FILE *fstab;    struct mntent *mnt;    if ( !(fstab = setmntent(MNTTAB, "r")) ) {      fprintf(stderr, "%s: cannot open " MNTTAB "\n", program);    }        while ( (mnt = getmntent(fstab)) ) {      if ( !strcmp(device, mnt->mnt_fsname) &&	   ( !strcmp(mnt->mnt_type, "msdos") ||	     !strcmp(mnt->mnt_type, "umsdos") ||	     !strcmp(mnt->mnt_type, "vfat") ||	     !strcmp(mnt->mnt_type, "uvfat") ||	     !strcmp(mnt->mnt_type, "auto") ) &&	   hasmntopt(mnt, "user") &&	   !hasmntopt(mnt, "ro") &&	   mnt->mnt_dir[0] == '/' &&	   !!hasmntopt(mnt, "loop") == !!S_ISREG(st.st_mode)) {	/* Okay, this is an fstab entry we should be able to live with. */	mntpath = mnt->mnt_dir;	break;      }    }    endmntent(fstab);    if ( !mntpath ) {      fprintf(stderr, "%s: not root and no appropriate entry for %s in "	      MNTTAB "\n", program, device);      exit(1);    }      f = fork();    if ( f < 0 ) {      perror(program);      exit(1);    } else if ( f == 0 ) {      execl(_PATH_MOUNT, _PATH_MOUNT, mntpath, NULL);      _exit(255);		/* If execl failed, trouble... */    }  } else {    int i = 0;    /* We're root.  Make a temp dir and pass all the gunky options to mount. */    do {      sprintf(mntname, "/tmp/syslinux.mnt.%lu.%d", (unsigned long)getpid(), i++);    } while ( (errno = 0, mkdir(mntname, 0700) == -1) &&	      (errno == EEXIST || errno == EINTR) );    if ( errno ) {      perror(program);      exit(1);    }        mntpath = mntname;    f = fork();    if ( f < 0 ) {      perror(program);      rmdir(mntpath);      exit(1);    } else if ( f == 0 ) {      if ( S_ISREG(st.st_mode) )	execl(_PATH_MOUNT, _PATH_MOUNT, "-t", "msdos", "-o", "loop", "-w",	      device, mntpath);      else	execl(_PATH_MOUNT, _PATH_MOUNT, "-t", "msdos", "-w", device, mntpath);      _exit(255);		/* execl failed */    }  }  w = waitpid(f, &status, 0);  if ( w != f || status ) {    if ( !euid )      rmdir(mntpath);    exit(1);			/* Mount failed */  }  ldlinux_name = alloca(strlen(mntpath)+13);  if ( !ldlinux_name ) {    perror("malloc");    err = 1;    goto umount;  }  sprintf(ldlinux_name, "%s/ldlinux.sys", mntpath);  unlink(ldlinux_name);  fd = open(ldlinux_name, O_WRONLY|O_CREAT|O_TRUNC, 0444);  if ( fd < 0 ) {    perror(device);    err = 1;    goto umount;  }  cdp = ldlinux;  left = ldlinux_len;  while ( left ) {    nb = write(fd, cdp, left);    if ( nb == -1 && errno == EINTR )      continue;    else if ( nb <= 0 ) {      perror(device);      err = 1;      goto umount;    }    dp += nb;    left -= nb;  }  /*   * I don't understand why I need this.  Does the DOS filesystems   * not honour the mode passed to open()?   */  my_umask = umask(0777);  umask(my_umask);  fchmod(fd, 0444 & ~my_umask);  close(fd);umount:  f = fork();  if ( f < 0 ) {    perror("fork");    exit(1);  } else if ( f == 0 ) {    execl(_PATH_UMOUNT, _PATH_UMOUNT, mntpath, NULL);  }  w = waitpid(f, &status, 0);  if ( w != f || status ) {    exit(1);  }  sync();  if ( !euid )    rmdir(mntpath);  if ( err )    exit(err);  /*   * To finish up, write the boot sector   */  dev_fd = open(device, O_RDWR);  if ( dev_fd < 0 ) {    perror(device);    exit(1);  }  /* Copy the old superblock into the new boot sector */  memcpy(bootsect+bsCopyStart, sectbuf+bsCopyStart, bsCopyLen);    dp = bootsect;  left = bootsect_len;  while ( left ) {    nb = write(dev_fd, dp, left);    if ( nb == -1 && errno == EINTR )      continue;    else if ( nb <= 0 ) {      perror(device);      exit(1);    }        dp += nb;    left -= nb;  }  close(dev_fd);  /* Done! */  return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
jvid福利写真一区二区三区| 3d成人h动漫网站入口| 91精品福利视频| 7777精品久久久大香线蕉| 久久久久久久综合| 亚洲综合久久久久| 国产乱码字幕精品高清av| 在线视频欧美区| 中文一区二区在线观看| 日韩在线一二三区| 日本久久精品电影| 中文字幕欧美激情| 国内精品视频666| 欧美人妖巨大在线| 亚洲蜜臀av乱码久久精品蜜桃| 久久成人免费电影| 欧美日韩精品欧美日韩精品| 国产精品人妖ts系列视频| 美女任你摸久久| 欧美日韩日日夜夜| 亚洲自拍另类综合| 97精品久久久久中文字幕| 欧美精品一区二| 丝袜a∨在线一区二区三区不卡| av不卡在线观看| 欧美国产日韩a欧美在线观看| 免费成人美女在线观看.| 5月丁香婷婷综合| 亚洲成人自拍网| 欧美综合天天夜夜久久| 国产精品二三区| 播五月开心婷婷综合| 国产午夜精品久久久久久久| 国产一区不卡精品| 欧美成人性战久久| 久久99国产精品麻豆| 欧美一区二区三区在线视频| 丝袜国产日韩另类美女| 欧美美女喷水视频| 婷婷丁香激情综合| 欧美一级国产精品| 久久超碰97人人做人人爱| 日韩欧美国产综合一区| 麻豆精品在线看| 精品乱人伦小说| 国产麻豆午夜三级精品| 国产日韩综合av| 9色porny自拍视频一区二区| 国产精品久久久99| 在线视频欧美精品| 五月婷婷久久丁香| 精品国产一区二区三区久久久蜜月 | 欧美亚洲综合在线| 亚洲成人资源在线| 91精品久久久久久久91蜜桃| 免费看欧美美女黄的网站| 2020国产精品自拍| 北条麻妃一区二区三区| 亚洲欧美日韩精品久久久久| 欧洲亚洲精品在线| 久久精品国产在热久久| 久久精品一区二区三区不卡| 成人av在线网站| 亚洲一线二线三线久久久| 制服.丝袜.亚洲.另类.中文| 国内精品视频666| 成人免费在线视频| 欧美电影一区二区三区| 极品尤物av久久免费看| 中文字幕在线一区免费| 在线成人午夜影院| 国产ts人妖一区二区| 亚洲国产精品久久久久秋霞影院| 欧美变态口味重另类| 成人的网站免费观看| 天天免费综合色| 国产欧美一区二区三区在线老狼| 色又黄又爽网站www久久| 免费观看30秒视频久久| √…a在线天堂一区| 日韩三级av在线播放| 成+人+亚洲+综合天堂| 日韩精品视频网| 亚洲色图欧美偷拍| 欧美成人激情免费网| 欧美色涩在线第一页| 国产一区91精品张津瑜| 丝袜国产日韩另类美女| 亚洲欧洲精品一区二区三区| 欧美一级日韩一级| 欧美视频自拍偷拍| 丁香一区二区三区| 老司机免费视频一区二区| 亚洲精品中文在线影院| 久久久亚洲精品石原莉奈| 欧美日韩精品电影| 99精品视频一区| 国产乱人伦偷精品视频不卡| 七七婷婷婷婷精品国产| 亚洲国产一二三| 亚洲黄色片在线观看| 中文字幕在线观看一区二区| 久久久久一区二区三区四区| 日韩亚洲国产中文字幕欧美| 欧美午夜一区二区三区| 99久久精品免费看国产| 国产精品1024| 国产乱码精品一区二区三区忘忧草| 日本午夜一区二区| 日韩一区欧美二区| 天天色天天操综合| 亚洲成人在线网站| 亚洲妇女屁股眼交7| 亚洲午夜久久久久中文字幕久| 亚洲欧美日韩人成在线播放| 国产精品久久久久影院色老大| 国产网站一区二区| 日本一区二区成人| 中文字幕免费观看一区| 国产亚洲欧美一级| 国产欧美综合在线观看第十页| 久久人人超碰精品| 久久久久国产精品人| 久久久久久一二三区| 久久精品欧美日韩| 国产日韩精品一区二区浪潮av| 久久看人人爽人人| 国产欧美久久久精品影院| 久久久精品国产免大香伊| 国产午夜精品久久| 日韩一区在线看| 怡红院av一区二区三区| 亚洲综合999| 日本欧美一区二区在线观看| 蜜臀久久99精品久久久久宅男| 麻豆国产一区二区| 国产精品自产自拍| 色综合久久综合网欧美综合网| 色欲综合视频天天天| 欧美精品自拍偷拍动漫精品| 91精品婷婷国产综合久久竹菊| 欧美成人国产一区二区| 国产欧美日韩一区二区三区在线观看 | 色婷婷精品久久二区二区蜜臀av| 91看片淫黄大片一级在线观看| 色偷偷成人一区二区三区91 | 成人午夜看片网址| 91亚洲大成网污www| 欧美日精品一区视频| 日韩欧美第一区| 亚洲欧美日韩电影| 久久99国产精品久久99| 91丨porny丨中文| 日韩一区二区三区在线观看| 国产欧美一区二区三区鸳鸯浴| 亚洲影视在线观看| 国产麻豆精品在线| 欧美性xxxxxxxx| 国产欧美一区在线| 奇米影视在线99精品| 91在线观看美女| 精品国精品自拍自在线| 一二三区精品视频| 成人做爰69片免费看网站| 4438成人网| 亚洲激情成人在线| 粉嫩av亚洲一区二区图片| 欧美一级xxx| 亚洲无人区一区| av成人免费在线观看| 26uuu亚洲综合色欧美 | 欧美猛男gaygay网站| 久久蜜桃一区二区| 偷拍一区二区三区四区| 国产成人欧美日韩在线电影 | 91丨porny丨在线| 欧美精品一区二区三区很污很色的 | 欧美高清性hdvideosex| 国产亚洲短视频| 久久99这里只有精品| 91亚洲精品一区二区乱码| 欧美一区日本一区韩国一区| 亚洲精品久久嫩草网站秘色| 韩国成人精品a∨在线观看| 欧美丝袜丝nylons| 樱桃视频在线观看一区| 国产精品77777竹菊影视小说| 一本久道久久综合中文字幕| 中文字幕免费在线观看视频一区| 天堂久久久久va久久久久| 大尺度一区二区| 国产精品国产三级国产aⅴ无密码| 日韩va亚洲va欧美va久久| 91成人看片片| 亚洲欧美区自拍先锋| 国产精品一级片| 久久久久久久久久久黄色| 五月婷婷久久综合| 日本道色综合久久| 亚洲狠狠爱一区二区三区|