(select_registry_t registry, int blockp);
extern int OS_test_select_descriptor
(int fd, int blockp, unsigned int mode);
+#ifdef ENABLE_SMP
+extern void OS_copy_select_registry
+ (select_registry_t from, select_registry_t to);
+#endif
extern int OS_pause (void);
#endif /* SCM_OSIO_H */
(ulong_to_integer (OS_select_registry_length (arg_select_registry (1))));
}
+DEFINE_PRIMITIVE ("COPY-SELECT-REGISTRY", Prim_copy_selreg, 2, 2, 0)
+{
+ PRIMITIVE_HEADER (2);
+#ifdef ENABLE_SMP
+ OS_copy_select_registry ((arg_select_registry (1)),
+ (arg_select_registry (2)));
+ PRIMITIVE_RETURN (UNSPECIFIC);
+#else
+ signal_error_from_primitive (ERR_UNIMPLEMENTED_PRIMITIVE);
+#endif
+}
+
DEFINE_PRIMITIVE ("TEST-SELECT-REGISTRY", Prim_test_selreg, 4, 4, 0)
{
PRIMITIVE_HEADER (4);
return (SR_N_FDS (r));
}
+#ifdef ENABLE_SMP
+void
+OS_copy_select_registry (select_registry_t from, select_registry_t to)
+{
+ struct select_registry_s * f = from;
+ struct select_registry_s * t = to;
+ int fl = SR_LENGTH (f);
+ int tl = SR_LENGTH (t);
+ if (tl < fl)
+ {
+ free (SR_ENTRIES (t));
+ (SR_ENTRIES (t)) = (UX_malloc (SR_BYTES (fl)));
+ (SR_LENGTH (t)) = fl;
+ }
+ memcpy ((SR_ENTRIES (t)), (SR_ENTRIES (f)), (SR_BYTES (SR_N_FDS (f))));
+ (SR_N_FDS (t)) = (SR_N_FDS (f));
+}
+#endif
+
void
OS_select_registry_result (select_registry_t registry,
unsigned int index,
return (SR_N_FDS (r));
}
+#ifdef ENABLE_SMP
+void
+OS_copy_select_registry (select_registry_t from, select_registry_t to)
+{
+ struct select_registry_s * f = from;
+ struct select_registry_s * t = to;
+
+ (* (SR_QREADERS (t))) = (* (SR_QREADERS (f)));
+ (* (SR_QWRITERS (t))) = (* (SR_QWRITERS (f)));
+ (* (SR_RREADERS (t))) = (* (SR_RREADERS (f)));
+ (* (SR_RWRITERS (t))) = (* (SR_RWRITERS (f)));
+ (SR_N_FDS (t)) = (SR_N_FDS (r));
+}
+#endif
+
void
OS_select_registry_result (select_registry_t registry,
unsigned int index,