BSD libc "Port C library from the OpenBSD"

  1. Introduction
  2. Function frequency count script
  3. string
  4. continue...

Last updated 2001-07-30 5:41 pm


Introduction

Feb. 6th, 2001
Wataru Nishida
Data structure of fdisk_disk
 
char* name Disk device name (eg. /dev/hda).
unsigned int size Disk size in kilobytes (1 KB = 1024 bytes).
char* partition_format

Partition type name. This name is derived from parsers[] defined in fdisk.c. Currently, TinyDebian's libfdisk supports only MS-DOS partitions.

"msdos"
"osf"
"sun"
"amiga"
"atari"
"mac"

fdisk_partition* partitions Linked-list of all partitions on this disk.
fdisk_partition* last_partition Pointer for last partition in the linked-partition list.
fdisk_disk* next Pointer for next disk in the linked-disk list.
Data structure of fdisk_partition
 
char* name Partition device name (eg. /dev/hda3).
char* mount_point Where to mount (eg. "/", "/var", "/usr").
int type

Partition type code.

  PTYPE_EMPTY 0 Blank
  PTYPE_DOSEXT 0x05 DOS extended
  PTYPE_WEXT 0x0F Windows extended
  PTYPE_LSWAP 0x82 Linux swap
  PTYPE_LINUX 0x83 Linux native
  PTYPE_LINUXEXT 0x85 Linux extended
  PTYPE_NFS 0x4E465300 NFS

 

unsigned int size Partition size in kilobytes (1 KB = 1024 bytes).
int in_use

Partition flag (Non zero = active).

fdisk_disk* disk Where is this partition?
fdisk_partition* next Pointer for next partition in the linked-list.
fdisk_partition* next_by_disk Pointer for next partition in the linked-list ordered by disk.
fdisk_partition* next_in_use Pointer for next partition in the active linked-list.

 

How to get and update the OpenBSD source tree?

In contrast to Linux, OpenBSD project maintains an unified source tree including kernel, libraries, developmental tools, system utilities, and so on. All of the source lists are located under "src" directory, and you can create everything you need from it. By the way, let's get the source tree.

Get tarballs

You can get everything from anonymous CVS, but it takes too much time. So, I recommend you to get the latest snapshots by tarball files in CD-ROM or FTP sites.

void fdisk_reread(void)
  1. fdisk_disks and fdisk_partitions are already defined?
    • free allocated memory blocks according to their linked-list.

Then extract src.tar.gz and srcsys.tar.gz at an appropriate directory (My case: /usr/src/openbsd/ and /usr/src/openbsd/src, respectively.).

CVS update

OpenBSD project provides anonymous CVS. You can keep your local source tree up to date at any time. Change into parent directory of "src" (My case: /usr/src/openbsd) and execute the following commands.

CVS access
     
cvs -d:pserver:anoncvs@anoncvs1.ca.openbsd.org:/cvs login (enter "anoncvs" as the password) cvs -z3 -d:pserver:anoncvs@anoncvs1.ca.openbsd.org:/cvs co -P src

Now you have the "current" source tree in you disk (At present, ./src requires 436MB disk space). It's really a treasure island, enjoy with me!

To HOME