[syslinux] port syslinux isohybrid perl script to C

P J P pj.pandit at yahoo.co.in
Tue Apr 13 21:39:11 PDT 2010


  Hi,

--- On Wed, 14/4/10, H. Peter Anvin <hpa at zytor.com> wrote:
> fwrite(3) is the best option.  Also keep in mind that you might be on a
> system of different native byte order.

  But, fwrite(3) is for writing data to the file. Whereas, the following block writes data to mbr buffer, which is then written to the file with write(2).

---
  memset(mbr, 0, 16);
  if (i == entry)
  {
      sprintf(mbr, "%hhu%hhu%hhu%hhu%hhu%hhu%hhu%hhu%u%u", 0x80, bhead,
                  bsect, bcyle, type, ehead, esect, ecyle, offset, psize);
  }
  mbr += 16
---



Thanks.
---
Regards
    -P J P
PS: Please don't send me html/attachment/Fwd mails






More information about the Syslinux mailing list