Merge "Remove patch to stop renaming errno." into main
diff --git a/Android.bp b/Android.bp
index 70ae2f6..5df7d73 100644
--- a/Android.bp
+++ b/Android.bp
@@ -34,8 +34,6 @@
     ],
     cfgs: [
         "libc",
-        "linux_kernel",
-        "linux_like",
         "static_assertions",
     ],
     rustlibs: [
@@ -51,4 +49,25 @@
     product_available: true,
     vendor_available: true,
     min_sdk_version: "30",
+    target: {
+        linux: {
+            cfgs: [
+                "linux_kernel",
+                "linux_like",
+            ],
+        },
+        android: {
+            cfgs: [
+                "linux_kernel",
+                "linux_like",
+            ],
+        },
+        darwin: {
+            cfgs: [
+                "apple",
+                "bsd",
+            ],
+        },
+    },
+
 }
diff --git a/cargo_embargo.json b/cargo_embargo.json
index 97ccea6..3ce4c7a 100644
--- a/cargo_embargo.json
+++ b/cargo_embargo.json
@@ -8,5 +8,14 @@
     "fs",
     "event"
   ],
-  "min_sdk_version": "30"
+  "min_sdk_version": "30",
+  "cfg_blocklist": [
+    "linux_like",
+    "linux_kernel"
+  ],
+  "package": {
+    "rustix": {
+      "add_module_block": "cargo_embargo_target_cfgs.bp"
+    }
+  }
 }
diff --git a/cargo_embargo_target_cfgs.bp b/cargo_embargo_target_cfgs.bp
new file mode 100644
index 0000000..8428117
--- /dev/null
+++ b/cargo_embargo_target_cfgs.bp
@@ -0,0 +1,20 @@
+target: {
+    linux: {
+        cfgs: [
+            "linux_kernel",
+            "linux_like",
+        ],
+    },
+    android: {
+        cfgs: [
+            "linux_kernel",
+            "linux_like",
+        ],
+    },
+    darwin: {
+        cfgs: [
+            "apple",
+            "bsd",
+        ],
+    },
+}