| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: patch-aa,v 1.15 2014/06/09 13:08:19 ryoon Exp $ | | 1 | $NetBSD: patch-aa,v 1.16 2014/06/16 13:26:25 jperkin Exp $ |
2 | | | 2 | |
3 | ioctl() takes u_long argument on NetBSD. | | 3 | ioctl() takes u_long argument on NetBSD. |
4 | On NetBSD<6 and 6.99.0-6.99.7, use third parameter in ioctl instead of varargs. | | 4 | On NetBSD<6 and 6.99.0-6.99.7, use third parameter in ioctl instead of varargs. |
5 | stat() system call has been versioned, use latest version when dlopen()ing. | | 5 | stat() system call has been versioned, use latest version when dlopen()ing. |
6 | Try more typical device names. | | 6 | Try more typical device names. |
7 | SOUND_PCM_* is not available on SunOS. | | 7 | SOUND_PCM_* is not available on SunOS. |
8 | | | 8 | |
9 | --- src/utils/padsp.c.orig 2014-01-23 18:57:55.000000000 +0000 | | 9 | --- src/utils/padsp.c.orig 2014-01-23 18:57:55.000000000 +0000 |
10 | +++ src/utils/padsp.c | | 10 | +++ src/utils/padsp.c |
11 | @@ -49,6 +49,9 @@ | | 11 | @@ -49,6 +49,9 @@ |
12 | #ifdef __linux__ | | 12 | #ifdef __linux__ |
13 | #include <linux/sockios.h> | | 13 | #include <linux/sockios.h> |
14 | #endif | | 14 | #endif |
| @@ -74,34 +74,34 @@ SOUND_PCM_* is not available on SunOS. | | | @@ -74,34 +74,34 @@ SOUND_PCM_* is not available on SunOS. |
74 | - _stat = (int (*)(const char *, struct stat *)) dlsym_fn(RTLD_NEXT, "stat"); \ | | 74 | - _stat = (int (*)(const char *, struct stat *)) dlsym_fn(RTLD_NEXT, "stat"); \ |
75 | + _stat = (int (*)(const char *, struct stat *)) dlsym_fn(RTLD_NEXT, STAT_FUNC); \ | | 75 | + _stat = (int (*)(const char *, struct stat *)) dlsym_fn(RTLD_NEXT, STAT_FUNC); \ |
76 | pthread_mutex_unlock(&func_mutex); \ | | 76 | pthread_mutex_unlock(&func_mutex); \ |
77 | } while(0) | | 77 | } while(0) |
78 | | | 78 | |
79 | @@ -2277,6 +2303,7 @@ static int dsp_ioctl(fd_info *i, unsigne | | 79 | @@ -2277,6 +2303,7 @@ static int dsp_ioctl(fd_info *i, unsigne |
80 | break; | | 80 | break; |
81 | } | | 81 | } |
82 | | | 82 | |
83 | +#ifndef __sun | | 83 | +#ifndef __sun |
84 | case SOUND_PCM_READ_RATE: | | 84 | case SOUND_PCM_READ_RATE: |
85 | debug(DEBUG_LEVEL_NORMAL, __FILE__": SOUND_PCM_READ_RATE\n"); | | 85 | debug(DEBUG_LEVEL_NORMAL, __FILE__": SOUND_PCM_READ_RATE\n"); |
86 | | | 86 | |
87 | @@ -2284,6 +2311,7 @@ static int dsp_ioctl(fd_info *i, unsigne | | 87 | @@ -2300,6 +2327,7 @@ static int dsp_ioctl(fd_info *i, unsigne |
88 | *(int*) argp = i->sample_spec.rate; | | 88 | *(int*) argp = pa_sample_size(&i->sample_spec)*8; |
89 | pa_threaded_mainloop_unlock(i->mainloop); | | 89 | pa_threaded_mainloop_unlock(i->mainloop); |
90 | break; | | 90 | break; |
91 | +#endif | | 91 | +#endif |
92 | | | 92 | |
93 | case SOUND_PCM_READ_CHANNELS: | | 93 | case SNDCTL_DSP_GETOPTR: { |
94 | debug(DEBUG_LEVEL_NORMAL, __FILE__": SOUND_PCM_READ_CHANNELS\n"); | | 94 | count_info *info; |
95 | @@ -2370,21 +2398,35 @@ fail: | | 95 | @@ -2370,21 +2398,35 @@ fail: |
96 | return ret; | | 96 | return ret; |
97 | } | | 97 | } |
98 | | | 98 | |
99 | +/* NetBSD < 6 and 6.99.0 - 6.99.6 used a different ioctl() definition */ | | 99 | +/* NetBSD < 6 and 6.99.0 - 6.99.6 used a different ioctl() definition */ |
100 | +#if defined(__NetBSD__) && (__NetBSD_Version__ < 600000000 || \ | | 100 | +#if defined(__NetBSD__) && (__NetBSD_Version__ < 600000000 || \ |
101 | + (__NetBSD_Version__ > 699000000 && __NetBSD_Version__ < 699000700) ) | | 101 | + (__NetBSD_Version__ > 699000000 && __NetBSD_Version__ < 699000700) ) |
102 | +# define OLD_NETBSD_IOCTL_CALL | | 102 | +# define OLD_NETBSD_IOCTL_CALL |
103 | +#endif | | 103 | +#endif |
104 | + | | 104 | + |
105 | #ifdef sun | | 105 | #ifdef sun |
106 | int ioctl(int fd, int request, ...) { | | 106 | int ioctl(int fd, int request, ...) { |
107 | +#elif defined(OLD_NETBSD_IOCTL_CALL) | | 107 | +#elif defined(OLD_NETBSD_IOCTL_CALL) |