Skip to content
Snippets Groups Projects
Select Git revision
  • f7752dd93e4485282f32c899a90e02e5a3107aa3
  • master default protected
2 results

test_2d_plot.py

Blame
  • os_netbsd.cpp 12.42 KiB
    /*
     * os_netbsd.c
     *
     * Home page of code is: http://smartmontools.sourceforge.net
     *
     * Copyright (C) 2003-4 Sergey Svishchev <smartmontools-support@lists.sourceforge.net>
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2, or (at your option)
     * any later version.
     *
     * You should have received a copy of the GNU General Public License
     * (for example COPYING); if not, write to the Free
     * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     *
     */
    
    #include "config.h"
    #include "atacmds.h"
    #include "scsicmds.h"
    #include "utility.h"
    #include "os_netbsd.h"
    
    const char *os_XXXX_c_cvsid = "$Id: os_netbsd.cpp,v 1.7 2004/07/09 12:38:04 ballen4705 Exp $" \
    ATACMDS_H_CVSID OS_NETBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
    
    /* global variable holding byte count of allocated memory */
    extern long long bytes;
    
    enum warnings {
      BAD_SMART, NO_3WARE, MAX_MSG
    };
    
    /* Utility function for printing warnings */
    void
    printwarning(int msgNo, const char *extra)
    {
      static int printed[] = {0, 0};
      static const char *message[] = {
        "Error: SMART Status command failed.\nPlease get assistance from \n" PACKAGE_HOMEPAGE "\nRegister values returned from SMART Status command are:\n",
        PACKAGE_STRING " does not currentlly support twe(4) devices (3ware Escalade)\n",
      };
    
      if (msgNo >= 0 && msgNo <= MAX_MSG) {
        if (!printed[msgNo]) {
          printed[msgNo] = 1;
          pout("%s", message[msgNo]);
          if (extra)
    	pout("%s", extra);
        }
      }
      return;
    }
    
    static const char *net_dev_prefix = "/dev/";
    static const char *net_dev_ata_disk = "wd";
    static const char *net_dev_scsi_disk = "sd";
    static const char *net_dev_scsi_tape = "enrst";
    
    /* Guess device type(ata or scsi) based on device name */
    int
    guess_device_type(const char *dev_name)
    {
      int len;
      int dev_prefix_len = strlen(net_dev_prefix);
    
      if (!dev_name || !(len = strlen(dev_name)))
        return GUESS_DEVTYPE_DONT_KNOW;