source: bootcd/isolinux/syslinux-6.03/com32/gpllib/disk/swsusp.c @ dd1be7c

Last change on this file since dd1be7c was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 712 bytes
Line 
1#include <stdlib.h>
2#include <string.h>
3
4#include <disk/swsusp.h>
5#include <disk/read.h>
6#include <disk/geom.h>
7
8/**
9 * swsusp_check - check if a (swap) partition contains the swsusp signature
10 * @drive_info: driveinfo struct describing the disk containing the partition
11 * @ptab;       Partition table of the partition
12 **/
13int swsusp_check(struct driveinfo *drive_info, struct part_entry *ptab)
14{
15    struct swsusp_header header_p;
16    int offset;
17    int found;
18
19    /* Read first page of the swap device */
20    offset = ptab->start_lba;
21    if (read_sectors(drive_info, &header_p, offset, PAGE_SIZE / SECTOR) == -1) {
22        return -1;
23    } else {
24        found = !memcmp(SWSUSP_SIG, header_p.sig, 10);
25        return found;
26    }
27}
Note: See TracBrowser for help on using the repository browser.