esnet/iperf

Possible compile on Solaris 10

Geschlossen

#964 geöffnet am 27.02.2020

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C (1.083 Forks)batch import
Help Wantedenhancementportability

Repository-Metriken

Stars
 (4.946 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 18T 1h) (4 gemergte PRs in 30 T)

Beschreibung

EDIT: Reformatted code for legibility. --bmah

Context

  • Version of iperf3: 3.7

  • Hardware: Sparc

  • Operating system (and distribution, if any):

Solaris 10

  • Other relevant information (for example, non-default compilers, libraries, cross-compiling, etc.):

gcc

  • Possible Solution

Not being used with pull request I submit here some code that seems to fix something under Solaris 10: Add the follwing in iperf_auth.c found this on https://github.com/firnsy/barnyard2/issues/98

#if defined(__sun)
/* Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> */
char *
strndup (const char *s, size_t n)
{
  char *result;
  size_t len = strlen (s);

  if (n < len)
    len = n;

  result = (char *) malloc (len + 1);
  if (!result)
    return 0;

  memcpy (result, s, len);
  result[len] = '\0';
  return(result);
}
#endif

Contributor Guide