File: getgeo.c

package info (click to toggle)
acorn-fdisk 3.0.6-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,068 kB
  • sloc: ansic: 5,422; makefile: 99
file content (35 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * lib/part/getgeo.c
 *
 * Copyright (C) 1997,1998 Russell King
 */
#include <assert.h>
#include <stdlib.h>

#include "util/debug.h"
#include "part/part.h"

/* Prototype: u_int part_getgeometry (part_t *part, geometry_t *geo)
 * Function : Get the geometry of the drive.
 * Params   : part - partitionable device
 *          : geo  - geometry structure
 * Returns  : FALSE on error
 * Notes    : Returns blkio's idea of geometry
 */
u_int part_getgeometry (part_t *part, geometry_t *geo)
{
  u_int ret;

  assert(part != NULL);
  assert(geo != NULL);

  dbg_printf("part_getgeometry()");
  dbg_level_up();

  ret = blkio_getgeometry(part->blkio, geo);

  dbg_level_down();
  dbg_printf("ret %s", ret ? "ok" : "error");

  return ret;
}