smartmontools SVN Rev 5613
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Namespaces | Macros | Functions | Variables
os_darwin.cpp File Reference
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <mach/mach_init.h>
#include <sys/utsname.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOReturn.h>
#include <IOKit/IOBSD.h>
#include <IOKit/storage/IOBlockStorageDevice.h>
#include <IOKit/storage/IOStorageDeviceCharacteristics.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/storage/ata/IOATAStorageDefines.h>
#include <IOKit/storage/ata/ATASMARTLib.h>
#include <CoreFoundation/CoreFoundation.h>
#include "config.h"
#include "atacmds.h"
#include "scsicmds.h"
#include "nvmecmds.h"
#include "utility.h"
#include "os_darwin.h"
#include "dev_interface.h"
Include dependency graph for os_darwin.cpp:

Go to the source code of this file.


class  os::darwin_smart_device
 Implement shared open/close routines with old functions. More...
class  os::darwin_ata_device
 Implement standard ATA support. More...
class  os::darwin_smart_interface
 Implement platform interface. More...
class  os::darwin_nvme_device
 NVMe support. More...


namespace  os


#define ARGUSED(x)   ((void)(x))


static bool os::is_smart_capable (io_object_t dev, const char *type)
static int os::make_device_names (char ***devlist, const char *name)
static void os::free_devnames (char **devnames, int numdevs)


const char * os_darwin_cpp_cvsid
static const char smartctl_examples []
struct {
   io_object_t   ioob
   IOCFPlugInInterface **   plugin
   IOATASMARTInterface **   smartIf
   IONVMeSMARTInterface **   smartIfNVMe
devices [20]
const char * dev_darwin_cpp_cvsid

Macro Definition Documentation


#define ARGUSED (   x)    ((void)(x))

Definition at line 39 of file os_darwin.cpp.

Variable Documentation

◆ dev_darwin_cpp_cvsid

const char* dev_darwin_cpp_cvsid
Initial value:
= "$Id: os_darwin.cpp 5209 2021-02-14 18:02:51Z samm2 $"
Definition: dev_interface.h:14

Definition at line 68 of file os_darwin.cpp.


struct { ... } devices[20]

◆ ioob

io_object_t ioob

Definition at line 62 of file os_darwin.cpp.

◆ os_darwin_cpp_cvsid

const char* os_darwin_cpp_cvsid
Initial value:
="$Id: os_darwin.cpp 5209 2021-02-14 18:02:51Z samm2 $"
Definition: atacmds.h:16
Definition: os_darwin.h:14
Definition: scsicmds.h:22
Definition: utility.h:16

Definition at line 41 of file os_darwin.cpp.

◆ plugin

IOCFPlugInInterface** plugin

Definition at line 63 of file os_darwin.cpp.

◆ smartctl_examples

const char smartctl_examples[]
Initial value:
"=================================================== SMARTCTL EXAMPLES =====\n\n"
" smartctl -a disk0 (Prints all SMART information)\n\n"
" smartctl -t long /dev/disk0 (Executes extended disk self-test)\n\n"
" smartctl --smart=on --saveauto=on /dev/rdisk0 (Enables SMART on first disk)\n\n"
" smartctl --attributes --log=selftest --quietmode=errorsonly /dev/disk0\n"
" (Prints Self-Test & Attribute errors)\n\n"
" smartctl -a IOService:/MacRISC2PE/pci@f4000000/AppleMacRiscPCI/ata-6@D/AppleKauaiATA/ATADeviceNub@0/IOATABlockStorageDriver/IOATABlockStorageDevice\n"
" (You can use IOService: ...)\n\n"
" smartctl -c IODeviceTree:/pci@f4000000/ata-6@D/@0:0\n"
" (... Or IODeviceTree:)\n"

Definition at line 45 of file os_darwin.cpp.

◆ smartIf

IOATASMARTInterface** smartIf

Definition at line 64 of file os_darwin.cpp.

◆ smartIfNVMe

IONVMeSMARTInterface** smartIfNVMe

Definition at line 65 of file os_darwin.cpp.