 }
 
 // Failed semaphore creation.
+#if !os(Android) // Android doesn’t implement sem_open and always return ENOSYS
 POSIXTests.test("sem_open fail") {
   let sem = sem_open(semaphoreName, 0)
   expectEqual(SEM_FAILED, sem)
   expectEqual(ENOENT, errno)
 }
+#endif
 
 // Successful semaphore creation.
+#if !os(Android) // Android doesn’t implement sem_open and always return ENOSYS
 POSIXTests.test("sem_open success") {
   let sem = sem_open(semaphoreName, O_CREAT, 0o777, 1)
   expectNotEqual(SEM_FAILED, sem)

  let res2 = sem_unlink(semaphoreName)
  expectEqual(0, res2)
}

// Fail because the semaphore already exists.
POSIXTests.test("sem_open existing O_EXCL fail") {
  let sem = sem_open(semaphoreName, O_CREAT, 0o777, 1)
  expectNotEqual(SEM_FAILED, sem)

  let res2 = sem_unlink(semaphoreName)
  expectEqual(0, res2)
}
#endif

// Successful semaphore creation with O_EXCL.
#if !os(Android) // Android doesn’t implement sem_open and always return ENOSYS
POSIXTests.test("sem_open O_EXCL success") {
  let sem = sem_open(semaphoreName, O_CREAT | O_EXCL, 0o777, 1)
  expectNotEqual(SEM_FAILED, sem)
