Skip to content
Snippets Groups Projects
Select Git revision
  • 8ef80f6aecd77095486fa2ef04094254dfda79a9
  • master default protected
  • Binary
  • add-version-information
  • os-path-join
  • develop-GA
  • timeFstatmap
  • add-higher-spindown-components
  • develop-DK
  • adds-header-to-grid-search
  • v1.3
  • v1.2
  • v1.1.2
  • v1.1.0
  • v1.0.1
15 results

long_transient_search_make_simulated_data.py

Blame
  • Forked from Gregory Ashton / PyFstat
    Source project has a limited visibility.
    os_netbsd.cpp 12.40 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.6 2004/04/19 03:57:38 shattered 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;